From 8e377d0e742b1eb158630088a16211b97fdc6f69 Mon Sep 17 00:00:00 2001 From: Michael Tintiuc Date: Sat, 1 Feb 2020 15:44:04 +0200 Subject: [PATCH 1/3] Fixes #116. Listen to audio focus change --- src/component/mediaPlayer/view.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/component/mediaPlayer/view.js b/src/component/mediaPlayer/view.js index 53af706..e9e0acf 100644 --- a/src/component/mediaPlayer/view.js +++ b/src/component/mediaPlayer/view.js @@ -167,7 +167,7 @@ class MediaPlayer extends React.PureComponent { togglePlay = () => { this.showPlayerControls(); - this.setState({ paused: !this.state.paused }, this.handlePausedState); + this.setState({ paused: !this.state.paused }, this.updateBackgroundMediaNotification); }; handlePausedState = () => { @@ -188,7 +188,7 @@ class MediaPlayer extends React.PureComponent { }; onEnd = () => { - this.setState({ paused: true }); + this.setState({ paused: true }, this.updateBackgroundMediaNotification); if (this.props.onPlaybackFinished) { this.props.onPlaybackFinished(); } @@ -327,6 +327,10 @@ class MediaPlayer extends React.PureComponent { } }; + onFocusChanged = evt => { + this.setState({ paused: !(this.state.paused && evt.hasAudioFocus) }, this.updateBackgroundMediaNotification); + }; + onBuffer = () => { if (!this.state.paused) { this.setState({ buffering: true }, () => this.manualHidePlayerControls()); @@ -469,6 +473,7 @@ class MediaPlayer extends React.PureComponent { onEnd={this.onEnd} onError={this.onError} minLoadRetryCount={999} + onAudioFocusChanged={this.onFocusChanged} /> {this.state.firstPlay && thumbnail && ( -- 2.45.2 From 4656be64a7408b76074e202d81913938d9d4972e Mon Sep 17 00:00:00 2001 From: YULIUS KURNIAWAN KRISTIANTO Date: Mon, 3 Feb 2020 04:40:41 +0700 Subject: [PATCH 2/3] Update LICENSE update year --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index eb958df..a293e51 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017-2019 LBRY Inc +Copyright (c) 2017-2020 LBRY Inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -- 2.45.2 From 76938d33490555aad0f1243dedbbeed9710c557c Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Mon, 10 Feb 2020 12:25:20 +0100 Subject: [PATCH 3/3] canonical urls for invite links --- package-lock.json | 4 ++-- package.json | 2 +- src/component/channelSelector/index.js | 4 ++-- src/component/drawerContent/index.js | 4 ++-- src/page/channel/index.js | 4 ++-- src/page/channelCreator/index.js | 4 ++-- src/page/file/index.js | 2 +- src/page/invites/index.js | 2 +- src/page/invites/view.js | 3 ++- src/utils/helper.js | 1 + 10 files changed, 16 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 989701f..5a36c0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7067,8 +7067,8 @@ } }, "lbry-redux": { - "version": "github:lbryio/lbry-redux#acbbc66b78566da11faa0fa8c65b44a8d4302c5e", - "from": "github:lbryio/lbry-redux#acbbc66b78566da11faa0fa8c65b44a8d4302c5e", + "version": "github:lbryio/lbry-redux#1de1d534c982db913f145a6171f39d7b8ebd61af", + "from": "github:lbryio/lbry-redux#1de1d534c982db913f145a6171f39d7b8ebd61af", "requires": { "proxy-polyfill": "0.1.6", "reselect": "^3.0.0", diff --git a/package.json b/package.json index cb615f1..48ad368 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "base-64": "^0.1.0", "@expo/vector-icons": "^8.1.0", "gfycat-style-urls": "^1.0.3", - "lbry-redux": "lbryio/lbry-redux#acbbc66b78566da11faa0fa8c65b44a8d4302c5e", + "lbry-redux": "lbryio/lbry-redux#1de1d534c982db913f145a6171f39d7b8ebd61af", "lbryinc": "lbryio/lbryinc#138a053754ec8e3da8e9bf153d32f527c962f25c", "lodash": ">=4.17.11", "merge": ">=1.2.1", diff --git a/src/component/channelSelector/index.js b/src/component/channelSelector/index.js index 29c4fe5..5bbb154 100644 --- a/src/component/channelSelector/index.js +++ b/src/component/channelSelector/index.js @@ -19,11 +19,11 @@ const select = state => ({ const perform = dispatch => ({ notify: data => dispatch(doToast(data)), createChannel: (name, amount) => dispatch(doCreateChannel(name, amount)), - fetchChannelListMine: () => dispatch(doFetchChannelListMine()), + fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)), getSync: (password, callback) => dispatch(doGetSync(password, callback)), }); export default connect( select, - perform + perform, )(ChannelSelector); diff --git a/src/component/drawerContent/index.js b/src/component/drawerContent/index.js index 48c9cc6..f1c92ef 100644 --- a/src/component/drawerContent/index.js +++ b/src/component/drawerContent/index.js @@ -9,10 +9,10 @@ const select = state => ({ }); const perform = dispatch => ({ - fetchChannelListMine: () => dispatch(doFetchChannelListMine()), + fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)), }); export default connect( select, - perform + perform, )(DrawerContent); diff --git a/src/page/channel/index.js b/src/page/channel/index.js index 59d6fc2..e0f100d 100644 --- a/src/page/channel/index.js +++ b/src/page/channel/index.js @@ -18,7 +18,7 @@ const select = (state, props) => ({ const perform = dispatch => ({ abandonClaim: (txid, nout) => dispatch(doAbandonClaim(txid, nout)), - fetchChannelListMine: () => dispatch(doFetchChannelListMine()), + fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)), fetchSubCount: claimId => dispatch(doFetchSubCount(claimId)), popDrawerStack: () => dispatch(doPopDrawerStack()), setSortByItem: item => dispatch(doSetSortByItem(item)), @@ -27,5 +27,5 @@ const perform = dispatch => ({ export default connect( select, - perform + perform, )(ChannelPage); diff --git a/src/page/channelCreator/index.js b/src/page/channelCreator/index.js index 8f47ad3..1e48c9f 100644 --- a/src/page/channelCreator/index.js +++ b/src/page/channelCreator/index.js @@ -37,7 +37,7 @@ const perform = dispatch => ({ notify: data => dispatch(doToast(data)), clearChannelFormState: () => dispatch(doClearChannelFormState()), createChannel: (name, amount, optionalParams) => dispatch(doCreateChannel(name, amount, optionalParams)), - fetchChannelListMine: () => dispatch(doFetchChannelListMine()), + fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)), getSync: (password, callback) => dispatch(doGetSync(password, callback)), updateChannel: params => dispatch(doUpdateChannel(params)), updateChannelFormState: data => dispatch(doUpdateChannelFormState(data)), @@ -48,5 +48,5 @@ const perform = dispatch => ({ export default connect( select, - perform + perform, )(ChannelCreator); diff --git a/src/page/file/index.js b/src/page/file/index.js index fb7ba88..cbf680d 100644 --- a/src/page/file/index.js +++ b/src/page/file/index.js @@ -82,7 +82,7 @@ const perform = dispatch => ({ fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)), fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)), fetchMyClaims: () => dispatch(doFetchClaimListMine()), - fetchChannelListMine: () => dispatch(doFetchChannelListMine()), + fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)), fetchViewCount: claimId => dispatch(doFetchViewCount(claimId)), fileGet: (uri, saveFile) => dispatch(doFileGet(uri, saveFile)), notify: data => dispatch(doToast(data)), diff --git a/src/page/invites/index.js b/src/page/invites/index.js index 230107a..7ce02e5 100644 --- a/src/page/invites/index.js +++ b/src/page/invites/index.js @@ -32,7 +32,7 @@ const select = state => ({ }); const perform = dispatch => ({ - fetchChannelListMine: () => dispatch(doFetchChannelListMine()), + fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)), fetchInviteStatus: () => dispatch(doFetchInviteStatus()), inviteNew: email => dispatch(doUserInviteNew(email)), pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_INVITES)), diff --git a/src/page/invites/view.js b/src/page/invites/view.js index efdf761..b644a47 100644 --- a/src/page/invites/view.js +++ b/src/page/invites/view.js @@ -68,7 +68,8 @@ class InvitesPage extends React.PureComponent { }; getLinkForChannel = channel => { - const { claimId, claimName } = parseURI(channel.permanent_url); + const parsedUrl = channel.canonical_url ? parseURI(channel.canonical_url) : parseURI(channel.permanent_url); + const { claimId, claimName } = parsedUrl; return `https://lbry.tv/$/invite/${claimName}:${claimId}`; }; diff --git a/src/utils/helper.js b/src/utils/helper.js index 49e2f62..dbe6003 100644 --- a/src/utils/helper.js +++ b/src/utils/helper.js @@ -10,6 +10,7 @@ const specialRouteMap = { about: Constants.DRAWER_ROUTE_ABOUT, allContent: Constants.DRAWER_ROUTE_TRENDING, channels: Constants.DRAWER_ROUTE_CHANNEL_CREATOR, + invite: Constants.DRAWER_ROUTE_INVITES, invites: Constants.DRAWER_ROUTE_INVITES, library: Constants.DRAWER_ROUTE_MY_LBRY, publish: Constants.DRAWER_ROUTE_PUBLISH, -- 2.45.2