Project

General

Profile

Feature #1405

Movie reloading when switching orientation

Added by megabitdragon about 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
-
Target version:
-
Start date:
06/07/2014
Due date:
% Done:

0%


Description

When screen orientation is changed, it looks like a new connection to the server/proxy is made and the movie is buffering for a long time. This transition should be smooth.

History

#1 Updated by megabitdragon about 8 years ago

  • Priority changed from Normal to Medium

#2 Updated by ming about 8 years ago

It is not actually a bug. The current implementation is completely correct—the Activity is recreated during the orientation change, so all its contents are destroyed and created again. There are two other ways. First—ignore recreation, not suggested solution, because framework knows better how to do it. Second—move the player to a Service. Personally I would leave it at as it is and move to a Service solution if there will be time for that.

#3 Updated by ming about 8 years ago

  • Status changed from New to Feedback
  • Assignee changed from ming to megabitdragon

#4 Updated by cpg about 8 years ago

  • Subject changed from Movie reloading when switching orrientation to Movie reloading when switching orientation

#5 Updated by megabitdragon about 8 years ago

  • Priority changed from Medium to Normal

#6 Updated by megabitdragon about 8 years ago

  • Tracker changed from Bug to Feature
  • Status changed from Feedback to Assigned
  • Priority changed from Normal to High

Let's do this for movies next.

#7 Updated by megabitdragon about 8 years ago

  • Assignee changed from megabitdragon to ming

#8 Updated by megabitdragon about 8 years ago

For this we want the movie not to reload when switching screen orientations. I guess we need a service for this as well.
The way it should work is as follows.
1. If the movie is playing the device should not go in standby.
2. If user locks the device manually the movies should pause
3. If user switches to another app the movie should pause
4. When user unlocks the screen or returns to the app the movies should be paused at the location was left off and ready to play.

#9 Updated by ming about 8 years ago

Pushed as a branch, but I’m stuck with an issue. When you rotate the phone video controls are not visible. If I try to show controls at VideoActivity#setUpVideoPlayback similar to AudioActivity#setUpAudioPlayback it throws a BadTokenException.

#10 Updated by megabitdragon about 8 years ago

Is it possible that you call show before the previous activity completes it;s life cycle?
I found this on stack overflow. Maybe it helps.

#11 Updated by ming about 8 years ago

It doesn’t seem to be leaking :-?

#12 Updated by megabitdragon about 8 years ago

I didn't looked at the code yet and I will not get to it until tomorrow probably, but if you didn't do it already can you also check this. It is an old discussion but who knows.

#13 Updated by ming about 8 years ago

  • Status changed from Assigned to Feedback
  • Assignee changed from ming to megabitdragon

Strange thing—it crashes only when no controls are shown and you rotate the device. I pushed a fix, but it mostly a black magic.

#14 Updated by megabitdragon about 8 years ago

As of right now it works seamless on my device (Nexus 10). I'll test some more and take a look at code as well.

#15 Updated by cpg about 8 years ago

for me, the rotation works well. it's virtually seamless, great job! (black magic non-withstanding).

however, the controls often disappear. tapping in the movie will not bring them back.

i noticed tapping in the notification area will bring them, but not the bottom controls, just the top navbar row (logo + movie name). changing the volume seems to bring them both (top and bottom) fairly reliably.

since there is discrepancy and it works for @megabitdragon, perhaps it's my phone running aosp 4.3. so i released this branch to the community as 0.1.6 to see what they experience.

#16 Updated by ming about 8 years ago

Strange but I don’t see your release or merge commit. Since the initial issue seems to be solved let’s close it and open / work on other issues, we already have one for disappearing controls.

#17 Updated by megabitdragon almost 8 years ago

  • Status changed from Feedback to Closed

Also available in: Atom