Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix wakelock on Android #884

Merged
merged 1 commit into from
Jan 26, 2016
Merged

fix wakelock on Android #884

merged 1 commit into from
Jan 26, 2016

Conversation

cvan
Copy link
Contributor

@cvan cvan commented Jan 22, 2016

Wakelock worked fine in WebKit on iOS because we never entered fullscreen (because WebKit doesn't support the Fullscreen API, heh).

Wakelock never worked on Android because we would (1) enable Wakelock, (2) enter fullscreen, (3) fullscreen event listener gets called, and (4) Wakelock is accidentally disabled.

@cvan cvan self-assigned this Jan 22, 2016
@cvan cvan added this to the 0.2.0 milestone Jan 22, 2016
@@ -29,8 +29,8 @@ function AndroidWakeLock() {

this.request = function() {
if (video.paused) {
// Base64 version of videos_src/no-sleep-60s.webm.
video.src = Util.base64('video/webm', 'GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4ECQoWBAhhTgGcBAAAAAAAH4xFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsggfG7AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU2LjQwLjEwMVdBjUxhdmY1Ni40MC4xMDFzpJAGSJTMbsLpDt/ySkipgX1fRImIQO1MAAAAAAAWVK5rAQAAAAAAADuuAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDmDgQEj44OEO5rKAOABAAAAAAAABrCBsLqBkB9DtnUBAAAAAAAAo+eBAKOmgQAAgKJJg0IAAV4BHsAHBIODCoAACmH2MAAAZxgz4dPSTFi5JACjloED6ACmAECSnABMQAADYAAAWi0quoCjloEH0ACmAECSnABNwAADYAAAWi0quoCjloELuACmAECSnABNgAADYAAAWi0quoCjloEPoACmAECSnABNYAADYAAAWi0quoCjloETiACmAECSnABNIAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTnghdwo5aBAAAApgBAkpwATOAAA2AAAFotKrqAo5aBA+gApgBAkpwATMAAA2AAAFotKrqAo5aBB9AApgBAkpwATIAAA2AAAFotKrqAo5aBC7gApgBAkpwATEAAA2AAAFotKrqAo5aBD6AApgDAkpwAQ2AAA2AAAFotKrqAo5aBE4gApgBAkpwATCAAA2AAAFotKrqAH0O2dQEAAAAAAACU54Iu4KOWgQAAAKYAQJKcAEvAAANgAABaLSq6gKOWgQPoAKYAQJKcAEtgAANgAABaLSq6gKOWgQfQAKYAQJKcAEsAAANgAABaLSq6gKOWgQu4AKYAQJKcAEqAAANgAABaLSq6gKOWgQ+gAKYAQJKcAEogAANgAABaLSq6gKOWgROIAKYAQJKcAEnAAANgAABaLSq6gB9DtnUBAAAAAAAAlOeCRlCjloEAAACmAECSnABJgAADYAAAWi0quoCjloED6ACmAECSnABJIAADYAAAWi0quoCjloEH0ACmAMCSnABDYAADYAAAWi0quoCjloELuACmAECSnABI4AADYAAAWi0quoCjloEPoACmAECSnABIoAADYAAAWi0quoCjloETiACmAECSnABIYAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTngl3Ao5aBAAAApgBAkpwASCAAA2AAAFotKrqAo5aBA+gApgBAkpwASAAAA2AAAFotKrqAo5aBB9AApgBAkpwAR8AAA2AAAFotKrqAo5aBC7gApgBAkpwAR4AAA2AAAFotKrqAo5aBD6AApgBAkpwAR2AAA2AAAFotKrqAo5aBE4gApgBAkpwARyAAA2AAAFotKrqAH0O2dQEAAAAAAACU54J1MKOWgQAAAKYAwJKcAENgAANgAABaLSq6gKOWgQPoAKYAQJKcAEbgAANgAABaLSq6gKOWgQfQAKYAQJKcAEagAANgAABaLSq6gKOWgQu4AKYAQJKcAEaAAANgAABaLSq6gKOWgQ+gAKYAQJKcAEZAAANgAABaLSq6gKOWgROIAKYAQJKcAEYAAANgAABaLSq6gB9DtnUBAAAAAAAAlOeCjKCjloEAAACmAECSnABF4AADYAAAWi0quoCjloED6ACmAECSnABFwAADYAAAWi0quoCjloEH0ACmAECSnABFoAADYAAAWi0quoCjloELuACmAECSnABFgAADYAAAWi0quoCjloEPoACmAMCSnABDYAADYAAAWi0quoCjloETiACmAECSnABFYAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTngqQQo5aBAAAApgBAkpwARUAAA2AAAFotKrqAo5aBA+gApgBAkpwARSAAA2AAAFotKrqAo5aBB9AApgBAkpwARQAAA2AAAFotKrqAo5aBC7gApgBAkpwARQAAA2AAAFotKrqAo5aBD6AApgBAkpwAROAAA2AAAFotKrqAo5aBE4gApgBAkpwARMAAA2AAAFotKrqAH0O2dQEAAAAAAACU54K7gKOWgQAAAKYAQJKcAESgAANgAABaLSq6gKOWgQPoAKYAQJKcAESAAANgAABaLSq6gKOWgQfQAKYAwJKcAENgAANgAABaLSq6gKOWgQu4AKYAQJKcAERgAANgAABaLSq6gKOWgQ+gAKYAQJKcAERAAANgAABaLSq6gKOWgROIAKYAQJKcAEQgAANgAABaLSq6gB9DtnUBAAAAAAAAlOeC0vCjloEAAACmAECSnABEIAADYAAAWi0quoCjloED6ACmAECSnABEAAADYAAAWi0quoCjloEH0ACmAECSnABD4AADYAAAWi0quoCjloELuACmAECSnABDwAADYAAAWi0quoCjloEPoACmAECSnABDoAADYAAAWi0quoCjloETiACmAECSnABDgAADYAAAWi0quoAcU7trAQAAAAAAABG7j7OBALeK94EB8YIBd/CBAw==');
// Base64 version of videos_src/no-sleep-120s.mp4.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why, but why isn't just a 1-second video used and looped? do you know, @caseyyee?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. Probably just because it's all in one place? If we can require/package it, it will fix the issue with not working in FF as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there isn't any video data, i don't think that it really makes a difference if it's 1s or 60s. I think 60s is good though -- prevents any hiccups from restarting/looping the video.

@dmarcos
Copy link
Member

dmarcos commented Jan 22, 2016

Have we confirmed that this fixes the problem on Android?

@cvan
Copy link
Contributor Author

cvan commented Jan 22, 2016

@dmarcos: I spent most of yesterday discovering and fixing mobile issues. and, yes, see the comment above where I discovered we were exiting wakelock immediately after enabling it. I have two other branches that (1) fix orientation messages for Android and (2) restructure things so we can emit events when VR mode is entered and exited - even on mobile. will open those later today.

I've been testing on various Android devices and my iPhone 6. I could use an iPhone 5 if anyone has one.

I'll remove the commit to bump wakelock; I'll handle in another PR since it's unrelated to the original issue of wakelock not working on Android.

@ngokevin
Copy link
Member

FYI #776 introduces VR events.

@cvan
Copy link
Contributor Author

cvan commented Jan 22, 2016

rr? @dmarcos

@ngokevin: lol gd, looks like most of refactoring I did yesterday is moot with your changes. happy that you did it, but sad that I didn't know you were working on that. I thought you were working on a mechanism of simply hiding the UI. is there an issue on file for the huge entirety of PR #776? that's why we have issues on file.

@ngokevin
Copy link
Member

Sorry, I should've went into more detail and asked what you were working on to make sure we didn't collide. I added events because splitting out into components required some form of communication across the components. And I should have attached issues.

@cvan cvan changed the title bump wakelock lib + fix wakelock on Android fix wakelock on Android Jan 23, 2016
@dmarcos
Copy link
Member

dmarcos commented Jan 23, 2016

Tests not passing

@cvan
Copy link
Contributor Author

cvan commented Jan 25, 2016

Tests not passing

Looks like the build was terminated?

@ngokevin
Copy link
Member

You can restart the build in Travis as I did this morning if the failures look unrelated or intermittent.

@cvan
Copy link
Contributor Author

cvan commented Jan 25, 2016

You can restart the build in Travis as I did this morning if the failures look unrelated or intermittent.

yep, I did 15 min ago and it's passing now

dmarcos added a commit that referenced this pull request Jan 26, 2016
@dmarcos dmarcos merged commit d192713 into aframevr:dev Jan 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants