Commit graph

336 commits

Author SHA1 Message Date
TobiGr
2f5c1f5732 Do not save playback position when watch history is disabled 2019-08-13 14:39:57 +02:00
Stypox
845c0a0098 Fix player resume 2019-08-11 22:10:05 +02:00
Stypox
382c943917 Fix crash when closing a not-yet-loaded popup. 2019-07-25 12:32:56 +02:00
Christian Schabesberger
7164d85479 Merge branch 'dev' into issue-2240 2019-07-21 16:07:32 +02:00
Alan Nelson
c5b7f59514 Add title to additional metadata object 2019-07-11 00:48:28 -05:00
Alan Nelson
98eeae4bf5 Add current and total track numbers to metadata 2019-07-09 22:37:03 -05:00
Alan Nelson
d96e371ad2 Fix Bluetooth AVRCP duration metadata 2019-07-09 22:34:18 -05:00
Marcel Dopita
299933b178 Handle (auto)rotation changes during activity lifecycle
Fixes #1156
2019-07-04 07:30:01 +02:00
Vasily
ea8bdd8835 Merge branch 'dev' into playback_state_list 2019-06-23 20:23:29 +03:00
kapodamy
db76d1e179 Merge branch 'dev' into ps-branch 2019-06-14 12:55:49 -03:00
Redirion
c259eaeeeb Fixed selected subtitle stream not being shown
closes #2393
this ammends my obviously incomplete fix in PR #2311.

This is just an UI issue. Subtitle track selection works, it just shows "No Captions" unfortunately.
2019-06-12 14:44:36 +02:00
kapodamy
7ca7952790 Implement Storage Access Framework
* re-work finished mission database
* re-work DownloadMission and bump it Serializable version
* keep the classic Java IO API
* SAF Tree API support on Android Lollipop or higher
* add wrapper for SAF stream opening
* implement Closeable in SharpStream to replace the dispose() method

* do required changes for this API:
** remove any file creation logic from DownloadInitializer
** make PostProcessing Serializable and reduce the number of iterations
** update all strings.xml files
** storage helpers: StoredDirectoryHelper & StoredFileHelper
** best effort to handle any kind of SAF errors/exceptions
2019-06-03 18:16:41 -03:00
Robin
42383f4faa Readd CustomTrackSelector 2019-04-28 01:45:19 +02:00
Vasiliy
36a34bd477 Merge branch 'dev' into playback_state_list 2019-04-27 17:37:43 +03:00
Tobias Groza
a0690d3d2b Merge remote-tracking branch 'TeamNewPipe/dev' into close_button 2019-04-13 18:18:17 +02:00
Vasiliy
2e36b05a50 Implement playback state management 2019-04-13 13:34:36 +03:00
Stypox
763ad613d4 Implemented share button in MainVideoPlayer
Android Studio also decided to change the indentation of some lines
2019-04-06 20:27:13 +02:00
Ritvik Saraf
abcbc333e5 seek on clicking timestamp links in comments 2019-03-13 07:01:24 +05:30
Robin
b2d3879610 Merge branch 'exoplayerupdate' of https://github.com/Redirion/NewPipe into exoplayerupdate 2019-03-06 09:38:17 +01:00
Robin
924b16c9ef Fix for wrong case after language normalization 2019-03-06 09:37:55 +01:00
Redirion
72a82a31f2 Merge branch 'dev' into exoplayerupdate 2019-03-05 21:44:27 +01:00
Tobias Groza
c8ed67f8be Update app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java
Co-Authored-By: Redirion <redirion@web.de>
2019-03-05 20:57:05 +01:00
Robin
b84c243445 Removed unused import 2019-03-05 19:54:37 +01:00
Robin
86c1328adf NOTE for legacy version: Removed Lint markers and completely dropped Jelly Bean workarounds 2019-03-05 19:48:39 +01:00
Robin
63e02fae7a Update ExoPlayer to 2.9.6, including httook dependency and deprecations 2019-03-05 18:05:44 +01:00
Redirion
694688cd85 Merge branch 'dev' into patch-1 2019-03-05 17:57:52 +01:00
Redirion
38d7dc7140 Improved performance of getTimeString
This pull requests complements pull request  #2178 by reducing general computational time for the method getTimeString.

On my local machine (Desktop PC with Java) my tests with a sample size of 10000 calls to the method with param 86400001 showed a performance improvement of about 50%.

See sample code below to reproduce:

    private static final StringBuilder stringBuilder = new StringBuilder();
    private static final Formatter stringFormatter = new Formatter(stringBuilder, Locale.getDefault());
    
    public static String getTimeString(int milliSeconds) {
        int seconds = (milliSeconds % 60000) / 1000;
        int minutes = (milliSeconds % 3600000) / 60000;
        int hours = (milliSeconds % 86400000) / 3600000;
        int days = (milliSeconds % (86400000 * 7)) / 86400000;

        stringBuilder.setLength(0);
        return days > 0 ? stringFormatter.format("%d:%02d:%02d:%02d", days, hours, minutes, seconds).toString()
                : hours > 0 ? stringFormatter.format("%d:%02d:%02d", hours, minutes, seconds).toString()
                : stringFormatter.format("%02d:%02d", minutes, seconds).toString();
    }
    
    public static String getTimeStringL(int milliSeconds) {
        long seconds = (milliSeconds % 60000L) / 1000L;
        long minutes = (milliSeconds % 3600000L) / 60000L;
        long hours = (milliSeconds % 86400000L) / 3600000L;
        long days = (milliSeconds % (86400000L * 7L)) / 86400000L;

        stringBuilder.setLength(0);
        return days > 0 ? stringFormatter.format("%d:%02d:%02d:%02d", days, hours, minutes, seconds).toString()
                : hours > 0 ? stringFormatter.format("%d:%02d:%02d", hours, minutes, seconds).toString()
                : stringFormatter.format("%02d:%02d", minutes, seconds).toString();
    }
    
	public static void main(String[] args) throws Exception {
		final int SAMPLE_SIZE = 25000;
		long[] results = new long[SAMPLE_SIZE];
		for(int i = 0; i < SAMPLE_SIZE; i++) {
			long now = System.nanoTime();
			getTimeString(86400001);
			results[i] = System.nanoTime() - now;
		}
		long sum = 0;
		for(int i = 0; i < SAMPLE_SIZE; i++) {
			sum += results[i];
		}
		System.out.println("Average execution time: " + (sum/SAMPLE_SIZE));
		results = new long[SAMPLE_SIZE];
		for(int i = 0; i < SAMPLE_SIZE; i++) {
			long now = System.nanoTime();
			getTimeStringL(86400001);
			results[i] = System.nanoTime() - now;
		}
		sum = 0;
		for(int i = 0; i < SAMPLE_SIZE; i++) {
			sum += results[i];
		}
		System.out.println("Average execution time: " + (sum/SAMPLE_SIZE));
2019-03-04 15:45:59 +01:00
Redirion
100197d1a9 Cache duration String to improve performance
In VideoPlayer the Duration String is cached effectively by setting it to the playbackSeekBar. As the playbackSeekBar doesn't exist in BackgroundPlayer, using two addition variables will reduce performance impact of notification updates by almost 50% and thus perform similar to VideoPlayer.

This addresses issue #2170
2019-03-04 10:24:08 +01:00
Vasiliy
c174bc77f0 Fix AudioManager memory leak 2019-02-24 10:51:30 +02:00
Vasiliy
dab0036069 Merge branch 'dev' into close_button 2019-02-23 13:19:09 +02:00
Christian Schabesberger
5f5c7575d0 Merge branch 'dev' into dev 2019-02-19 17:35:49 +01:00
Christian Schabesberger
fa6cf0f345 Merge branch 'dev' into patch-1 2019-02-19 14:29:34 +01:00
kapodamy
dd80d24482 fix crash while switching from popup to fullscreen player, or closing the popup player. 2019-02-17 16:59:35 -03:00
Ritvik Saraf
4113e744c4 merged upstream/dev 2019-02-16 02:06:18 +05:30
Redirion
2e284ea3dc Fix delayed ducking of Audio
Scenario: listening to a video on NewPipe over Bluetooth and a Notification Sound causes audio focus event AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK.

Problem: With the current implementation animateAudio would cause the audio to reach the target volume AFTER the notification sound is played, which is irritating and annoying.

Solution: animateAudio should just be used on focusGain where it is sensible to increase audio gradually. On ducking event the reaction should be immediate.

This very simple fix does this. Please approve.
2019-02-14 09:52:46 +01:00
Christian Schabesberger
725b59d0a3 Merge branch 'dev' into ccc 2019-01-31 16:48:22 +01:00
Robin
442a38babc Add Artist and Duration to MediaDescription 2019-01-31 16:47:33 +01:00
Christian Schabesberger
4365f956f9 further compatiblity fix for meadic.ccc 2019-01-29 15:39:18 +01:00
Vasily
d11f7414e4 Show close button when playing completed 2018-12-27 16:51:48 +02:00
Ritvik Saraf
f3b2724975 merged upstream/dev 2018-12-20 08:51:44 +05:30
Christian Schabesberger
194eee9e64 Merge branch 'dev' into giga-postprocessing 2018-12-10 12:12:38 +01:00
kapodamy
f6db08404e Merge branch 'dev' into giga-postprocessing 2018-12-05 01:15:39 -03:00
Ritvik Saraf
5d659c24dc merged upstream/dev 2018-12-04 23:19:57 +05:30
Shivanju Awasthi
dbcaa2b00d Merge branch 'dev' into auto_queue_logic 2018-12-04 16:22:18 +00:00
Christian Schabesberger
31e4869673 Merge branch 'dev' into giga-postprocessing 2018-12-01 09:30:38 +01:00
Christian Schabesberger
112d21b20d Merge branch 'dev' into auto_queue_logic 2018-12-01 09:29:25 +01:00
Akash Agarwal
23272c7d1c Issue 1505: Delete on right swipe 2018-12-01 00:42:56 +05:30
kapodamy
0f8924d167 Merge branch 'dev' into giga-postprocessing 2018-11-28 22:53:29 -03:00
Shivanju Awasthi
d57fefafae Merge branch 'dev' into auto_queue_logic 2018-11-26 22:56:01 +05:30
Ping20002015
cc7f368d0e Merge branch 'dev' into master 2018-11-26 18:00:22 +01:00