Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
fix link & enable hls debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Elay committed Jul 28, 2017
1 parent b677cc8 commit 91dc95b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class App extends Component {
this.handlePlayButton = this.handlePlayButton.bind(this)

window.addEventListener('popstate', () => {
console.log('pop state')
this.setComponentState()
})
}
Expand All @@ -30,12 +31,12 @@ class App extends Component {

handlePlayButton () {
const { source, token } = this.state
let newUrl = ''
if (source) newUrl += `/?url=${source}`
let newUrl = window.location.href
if (source) newUrl += `?url=${source}`
if (token) newUrl += `&token=${token}`
if (source) {
this.setState({ readyToPlay: true })
window.history.pushState({}, '', newUrl)
this.setState({ readyToPlay: true })
}
}

Expand All @@ -61,7 +62,7 @@ class App extends Component {
autoPlay: true,
fluid: true,
hlsOptions: {
debug: false,
debug: true,
xhrSetup: (xhr) => {
if (!token) return false
xhr.setRequestHeader('Authorization', `Bearer ${token}`)
Expand Down

0 comments on commit 91dc95b

Please sign in to comment.