Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 8749935

Browse files
committed
Fix mp3 again
1 parent bd0fb00 commit 8749935

File tree

3 files changed

+104
-11
lines changed

3 files changed

+104
-11
lines changed

core/src/plugins/editor.soundmanager/res/js/Player.js

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,14 @@ class Player extends React.Component {
9191
whileplaying: () => soundObserver.whileplaying(id)
9292
})
9393

94-
// Adding autoplay, listening to previous sound finish events
95-
const previousSoundID = soundManager.soundIDs.indexOf(id) - 1
96-
if (previousSoundID > -1) {
97-
soundObserver.observe("soundfinish" + soundManager.soundIDs[previousSoundID], () => {
98-
soundManager.getSoundById(id).play()
99-
})
94+
if(!this.props.disableAutoPlay){
95+
// Adding autoplay, listening to previous sound finish events
96+
const previousSoundID = soundManager.soundIDs.indexOf(id) - 1
97+
if (previousSoundID > -1) {
98+
soundObserver.observe("soundfinish" + soundManager.soundIDs[previousSoundID], () => {
99+
soundManager.getSoundById(id).play()
100+
})
101+
}
100102
}
101103
})
102104

@@ -105,10 +107,21 @@ class Player extends React.Component {
105107
oCanvasCTX.translate(parseInt(style.width / 2), parseInt(style.height / 2));
106108
oCanvasCTX.rotate(deg2rad(-90))
107109

108-
soundObserver.observe("soundplay" + id, () => this.setState({status: STATUS_PLAYING}))
109-
soundObserver.observe("soundpause" + id, () => this.setState({status: STATUS_PAUSED}))
110-
soundObserver.observe("soundbuffering" + id, () => this.setState({status: STATUS_BUFFERING}))
111-
soundObserver.observe("soundresume" + id, () => this.setState({status: STATUS_PLAYING}))
110+
soundObserver.observe("soundplay" + id, () => {
111+
this.setState({status: STATUS_PLAYING});
112+
if(this.props.onPlay) this.props.onPlay();
113+
})
114+
soundObserver.observe("soundpause" + id, () => {
115+
this.setState({status: STATUS_PAUSED});
116+
if(this.props.onPause) this.props.onPause();
117+
})
118+
soundObserver.observe("soundbuffering" + id, () => {
119+
this.setState({status: STATUS_BUFFERING});
120+
})
121+
soundObserver.observe("soundresume" + id, () => {
122+
this.setState({status: STATUS_PLAYING});
123+
if(this.props.onPlay) this.props.onPlay();
124+
})
112125
soundObserver.observe("soundstop" + id, () => {
113126
clearCanvas(this.canvas)
114127
this.setState({status: STATUS_DEFAULT})
@@ -146,7 +159,7 @@ class Player extends React.Component {
146159

147160
// Making sure the status is correct if sound is already playing
148161
const sound = soundManager.getSoundById(id)
149-
if (sound && sound.playState == 1) {
162+
if (sound && sound.playState === 1) {
150163
if (sound.paused) {
151164
this.setState({
152165
status: STATUS_PAUSED

core/src/plugins/editor.soundmanager/res/js/editor.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,17 @@ import React, {Component} from 'react'
2222
import { connect } from 'react-redux'
2323
import { compose } from 'redux'
2424
import {Paper, Table, TableBody, TableRow, TableRowColumn } from 'material-ui'
25+
import Player from './Player'
26+
import HasherUtils from 'pydio/util/hasher'
2527

2628
class Editor extends Component {
2729

30+
constructor(props) {
31+
super(props);
32+
this.state = {showPlayer: true};
33+
}
34+
35+
2836
static get styles() {
2937
return {
3038
container: {
@@ -72,6 +80,9 @@ class Editor extends Component {
7280

7381
}
7482
})
83+
this.setState({showPlayer: false}, () => {
84+
this.setState({showPlayer: true});
85+
});
7586
}
7687

7788
if (sound) {
@@ -93,9 +104,42 @@ class Editor extends Component {
93104
render() {
94105

95106
const {node, selectionPlaying, selection, onRequestSelectionPlay} = this.props;
107+
const {showPlayer} = this.state;
108+
console.log(selection, showPlayer);
109+
let url, crtIndex = 0;
110+
if(selection && showPlayer && node){
111+
url = pydio.Parameters.get('ajxpServerAccess') + '&get_action=audio_proxy&file=' + encodeURIComponent(HasherUtils.base64_encode(node.getPath()));
112+
selection.selection.forEach((n, i) => {
113+
if (n.getPath() === node.getPath()){
114+
crtIndex = i;
115+
}
116+
})
117+
}
96118

97119
return (
98120
<div style={Editor.styles.container}>
121+
{url &&
122+
<Player
123+
id={node.getPath()}
124+
url={url}
125+
rich={true}
126+
style={{width: 250, height: 200, margin: "auto"}}
127+
onReady={() => {}}
128+
onPlay={()=>{
129+
onRequestSelectionPlay(null, crtIndex, true);
130+
}}
131+
onPause={()=>{
132+
onRequestSelectionPlay(null, crtIndex, false);
133+
}}
134+
disableAutoPlay={true}
135+
onFinish={() => {
136+
// Handle autoPlay here
137+
if(selection && selection.selection && selection.selection[crtIndex+1]){
138+
onRequestSelectionPlay(null, crtIndex+1, true);
139+
}
140+
}}
141+
/>
142+
}
99143
<Paper zDepth={1} style={Editor.styles.paper}>
100144
<Table
101145
style={Editor.styles.table}

dist/php/8.2.2.html

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<div style='font-family: "Roboto", "Open sans", "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif; font-size: 16px;line-height: 1.5em; color: rgba(0,0,0,.87)' xmlns="http://www.w3.org/1999/html">
2+
3+
<h2>Pydio 8.2.2 was successfully installed!</h2>
4+
5+
This is a bugfix and security release for Pydio 8.X, see the Changelog below for commits details.
6+
7+
<ul>
8+
<li>Missing hook for filter_boot.conf (<a href="http://github.com/pydio/pydio-core/commit/2671537a5340b38210b4383a34652212418f872e">details</a>)</li>
9+
<li>Fix /. and /.. entries on specific mount points (<a href="http://github.com/pydio/pydio-core/commit/1d3e6229ce0483a625ca7631304b973746aa7ca5">details</a>)</li>
10+
<li>Fix share files on S3 root (<a href="http://github.com/pydio/pydio-core/commit/24dccc3c8caf683cf430984a7f1588d947bc4ee3">details</a>)</li>
11+
<li>Check zipBrowsingEnabled() when assigning ajxp_browsable_archive mimetype. (<a href="http://github.com/pydio/pydio-core/commit/03feba04edc2b304213758f4caa8d65b28d1d63c">details</a>)</li>
12+
<li>Fix upload on mobile apps (<a href="http://github.com/pydio/pydio-core/commit/87b66614d8742065c2300dc1d74e5e2d257970b6">details</a>)</li>
13+
<li>Hard-coded CORS support - to be added via a proper PSR-7 middleware (<a href="http://github.com/pydio/pydio-core/commit/efa296eb6e4ed24fd80659deee225beaf538dc36">details</a>)</li>
14+
<li>Escaping mount type (<a href="http://github.com/pydio/pydio-core/commit/2956b7a21f898f03dce76083c2d372baed757a4c">details</a>)</li>
15+
<li>PSR-7 middleware for CORS requests (<a href="http://github.com/pydio/pydio-core/commit/57776089cb056b451417516afab5113d185f14a2">details</a>)</li>
16+
<li>Latest changes for CORS middleware (<a href="http://github.com/pydio/pydio-core/commit/9c0c18f232332b839063880e0bfd6aa124d05fc7">details</a>)</li>
17+
<li>Making it configurable (<a href="http://github.com/pydio/pydio-core/commit/d663c7147244793e03f3cedddc33478ba63d4f41">details</a>)</li>
18+
<li>Fixing order or middlewares and default values (<a href="http://github.com/pydio/pydio-core/commit/f40f22ea9aa1f6bd8e9d9fc93bdb00b6e4c5f0ed">details</a>)</li>
19+
<li>Adding to the release note (<a href="http://github.com/pydio/pydio-core/commit/bd2a145c0c7d3ca859f1656e8996f3636c2e6c01">details</a>)</li>
20+
<li>Add new api 2 for migration to cells (<a href="http://github.com/pydio/pydio-core/commit/f3b884cf48ffe1c6102ec4a7ca79ca4e728d9b92">details</a>)</li>
21+
<li>Fix api2migration json (<a href="http://github.com/pydio/pydio-core/commit/1deb87e6ffe6236a44e01693290b34b557b4e9b3">details</a>)</li>
22+
<li>fix counting function (<a href="http://github.com/pydio/pydio-core/commit/d50d176cfa8ef1b97e71ca090413a352ee1f2ca5">details</a>)</li>
23+
<li>Change how we set up the Antivirus scanner command (<a href="http://github.com/pydio/pydio-core/commit/15c21374ac73051ffd98307c67fa0aebae94c51c">details</a>)</li>
24+
<li>Fix sanitization in odf iframe (<a href="http://github.com/pydio/pydio-core/commit/51321df3bd704ac724103fe63ae2d1e5a82565c6">details</a>)</li>
25+
<li>Use imports (<a href="http://github.com/pydio/pydio-core/commit/b4fbdfd1c5887ff6b0637aeceb1d41cd7fdee337">details</a>)</li>
26+
<li>Fix missing Download All button on minisite (<a href="http://github.com/pydio/pydio-core/commit/0cbcb06949aa827311c9973da98a0e40792fb2b3">details</a>)</li>
27+
<li>Make sure meta.monitor_fs is shown as experimental - Fix preferences serial/deserialization (<a href="http://github.com/pydio/pydio-core/commit/4803726ff73f91da3766fcce65b9c5dd20a5da30">details</a>)</li>
28+
<li>Update api2.json with shares API's (<a href="http://github.com/pydio/pydio-core/commit/d89eaab28576724811ab803409fe37c227b25d55">details</a>)</li>
29+
<li>Fix Quota computing that doubles quota uisage Refix preferences (<a href="http://github.com/pydio/pydio-core/commit/90e3d08084c1db021356bf8087ae2609e8054e3e">details</a>)</li>
30+
<li>Unserialize second parameter is not supported before php 7 (<a href="http://github.com/pydio/pydio-core/commit/f517e6ed51bbb946928515ecbfa06fe1aca44fb2">details</a>)</li>
31+
<li>From parameter is not used in send_mail action (<a href="http://github.com/pydio/pydio-core/commit/67792c9680ab62f4b617b91daea2c41fe6fb6d81">details</a>)</li>
32+
<li>Update user session if admin is editing himself. (<a href="http://github.com/pydio/pydio-core/commit/7f03a1f3c99f3f5944666c01692df29f364266fc">details</a>)</li>
33+
<li>Change indexes on ajxp_feed. (<a href="http://github.com/pydio/pydio-core/commit/b1b173daed0d29e656cf2ff917da8df19f15b905">details</a>)</li>
34+
<li>Put all executable paths inside config files (<a href="http://github.com/pydio/pydio-core/commit/bc3335e60cf48a6bb9188436ea312467d5c2ba36">details</a>)</li>
35+
</ul>
36+
</div>

0 commit comments

Comments
 (0)