Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug 1055198 - [Video] Hide soft home key during full screen video pla…
Browse files Browse the repository at this point in the history
…yback
  • Loading branch information
Russ Nicoletti committed Aug 29, 2014
1 parent be46e59 commit f44cbd0
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 0 deletions.
13 changes: 13 additions & 0 deletions apps/video/js/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,19 @@ function showOverlay(id) {
}

function setControlsVisibility(visible) {

// On phone with a software home button
if (isPhone && !ScreenLayout.getCurrentLayout('hardwareHomeButton')) {
if (visible) {
// When showing the controls, show the software home button.
document.mozCancelFullScreen();
}
else {
// When hiding the controls, hide the software home button.
dom.player.mozRequestFullScreen();
}
}

// in tablet landscape mode, we always shows controls in list layout. We
// don't need to hide it.
if (isPhone || isPortrait ||
Expand Down
1 change: 1 addition & 0 deletions apps/video/manifest.webapp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"url": "https://github.com/mozilla-b2g/gaia"
},
"fullscreen": true,
"fullscreen_layout": true,
"permissions": {
"storage":{},
"device-storage:pictures":{ "access": "readwrite" },
Expand Down
15 changes: 15 additions & 0 deletions apps/video/style/info.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,18 @@
/* no separator after the last item in the list */
border-bottom: none;
}

@media not all and (-moz-physical-home-button) {
@media (orientation: portrait) {
#info-view > menu button {
right: 0;
bottom: 5rem;
}
}
@media (orientation: landscape) {
#info-view > menu button {
right: 5rem;
bottom: 0;
}
}
}
56 changes: 56 additions & 0 deletions apps/video/style/video.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ span.line-break {
font-size: 2.1rem;
}

@media not all and (-moz-physical-home-button) {
@media (orientation: portrait) {
#thumbnail-list-view, #thumbnail-select-view, #player-view {
height: calc(100% - 5rem);
width: 100%;
}
}
@media (orientation: landscape) {
#thumbnail-list-view, #thumbnail-select-view, #player-view {
height: 100%;
width: calc(100% - 5rem);
}
}
}

/*
* Thumbnails are implemented as <li> elements in a <ul> with background-image
* set to display the image. We use background-size: cover to automatically
Expand Down Expand Up @@ -754,3 +769,44 @@ form[role="dialog"][data-type="confirm"] button.hidden {
border: none;
padding: 0;
}

@media not all and (-moz-physical-home-button) {
@media (orientation: portrait) {
#options-view {
right: 0;
bottom: 5rem;
}
}
@media (orientation: landscape) {

#options-view {
right: 5rem;
bottom: 0;
}
}
}

@media not all and (-moz-physical-home-button) {
@media (orientation: portrait) {
#options-cancel-button {
right: 0;
bottom: 5rem;
}
}

/*
* options-cancel-button needs special treatment because its position
* is 'fixed'. In order for 'right' to be applied, set 'left: auto'.
* Adjust width by 5+3 ('5' because right is shifted by 5, '3' because
* width has already been shortened by 3 by here:
* '[role="dialog"][data-type="action"] > menu > button' in action_menu.css
*/
@media (orientation: landscape) {
#options-cancel-button {
left: auto;
right: 5rem;
width: calc(100% - 8rem);
bottom: 0;
}
}
}
16 changes: 16 additions & 0 deletions shared/style/confirm.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,22 @@ form[role="dialog"][data-type="confirm"] menu {
bottom: 0;
}

@media not all and (-moz-physical-home-button) {
@media (orientation: portrait) {
form[role="dialog"][data-type="confirm"] menu {
left: 0;
bottom: 5rem;
}
}
@media (orientation: landscape) {
form[role="dialog"][data-type="confirm"] menu {
right: 5rem;
bottom: 0;
}
}
}


form[role="dialog"][data-type="confirm"] menu button::-moz-focus-inner {
border: none;
outline: none;
Expand Down

0 comments on commit f44cbd0

Please sign in to comment.