mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	Fixed issue with duration not working on songs without a start and end set
This commit is contained in:
		@@ -75,6 +75,13 @@ var Player = {
 | 
				
			|||||||
                    end: obj.np[0].end,
 | 
					                    end: obj.np[0].end,
 | 
				
			||||||
                    duration: obj.np[0].duration,
 | 
					                    duration: obj.np[0].duration,
 | 
				
			||||||
                };
 | 
					                };
 | 
				
			||||||
 | 
					                if(!obj.np[0].hasOwnProperty("start")) {
 | 
				
			||||||
 | 
					                    Player.np.start = 0;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if(!obj.np[0].hasOwnProperty("end")) {
 | 
				
			||||||
 | 
					                    Player.np.end = Player.np.duration;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                conf       = obj.conf[0];
 | 
					                conf       = obj.conf[0];
 | 
				
			||||||
                time       = obj.time;
 | 
					                time       = obj.time;
 | 
				
			||||||
                seekTo     = (time - conf.startTime) + Player.np.start;
 | 
					                seekTo     = (time - conf.startTime) + Player.np.start;
 | 
				
			||||||
@@ -96,6 +103,12 @@ var Player = {
 | 
				
			|||||||
                    end: obj.np[0].end,
 | 
					                    end: obj.np[0].end,
 | 
				
			||||||
                    duration: obj.np[0].duration,
 | 
					                    duration: obj.np[0].duration,
 | 
				
			||||||
                };
 | 
					                };
 | 
				
			||||||
 | 
					                if(!obj.np[0].hasOwnProperty("start")) {
 | 
				
			||||||
 | 
					                    Player.np.start = 0;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if(!obj.np[0].hasOwnProperty("end")) {
 | 
				
			||||||
 | 
					                    Player.np.end = Player.np.duration;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
                conf       = obj.conf[0];
 | 
					                conf       = obj.conf[0];
 | 
				
			||||||
                time       = obj.time;
 | 
					                time       = obj.time;
 | 
				
			||||||
                seekTo     = (time - conf.startTime) + Player.np.start;
 | 
					                seekTo     = (time - conf.startTime) + Player.np.start;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user