Automatically loop all videos in the iOS photos app.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Tweak.xm 1.5KB

il y a 4 ans
il y a 4 ans
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. typedef struct {
  2. long long value;
  3. int timescale;
  4. unsigned int flags;
  5. long long epoch;
  6. } TIME;
  7. @interface PUBrowsingVideoPlayer
  8. -(void)videoSessionDidPlayToEnd:(id)arg1; //IOS12
  9. -(void)avPlayer:(id)arg1 itemDidPlayToEnd:(id)arg2; //IOS13
  10. -(void)seekToTime:(TIME)arg1 toleranceBefore:(TIME)arg2 toleranceAfter:(TIME)arg3 completionHandler:(id)arg4;
  11. -(void)seekToTime:(TIME)arg1 completionHandler:(id)arg2;
  12. -(TIME)currentTime;
  13. -(void)_updateVideoSessionDesiredPlayState;
  14. -(void)rewindExistingPlayer;
  15. @property(nonatomic) long long desiredPlayState;
  16. @end
  17. %group IOS12
  18. %hook PUBrowsingVideoPlayer
  19. - (void)avPlayer:(id)arg1 itemDidPlayToEnd:(id)arg2 {
  20. // %orig (arg1, arg2);
  21. NSLog(@"AutoReplay - Ended 12");
  22. TIME t = [self currentTime];
  23. t.value = (long long) 0;
  24. t.timescale = 100;
  25. t.flags = (unsigned int) 1;
  26. [self seekToTime:t toleranceBefore:t toleranceAfter:t completionHandler:NULL];
  27. }
  28. %end
  29. %end //end group IOS12
  30. %group IOS13
  31. %hook PUBrowsingVideoPlayer
  32. static bool isFirstTryAfterEnding = false;
  33. - (void)videoSessionDidPlayToEnd:(id)arg1 {
  34. isFirstTryAfterEnding = true;
  35. [self rewindExistingPlayer];
  36. }
  37. - (void)_updateVideoSessionDesiredPlayState {
  38. if (self.desiredPlayState == 0 && isFirstTryAfterEnding) {
  39. isFirstTryAfterEnding = false;
  40. MSHookIvar<long long>(self, "_desiredPlayState") = 1;
  41. }
  42. %orig;
  43. }
  44. %end
  45. %end //end group IOS13
  46. %ctor {
  47. float version = [[[UIDevice currentDevice] systemVersion] floatValue];
  48. NSLog(@"AUTOREPLAY - Version: %f", version);
  49. if (version < 13) {
  50. %init(IOS12);
  51. } else {
  52. %init(IOS13);
  53. }
  54. }