You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

554 lines
15 KiB

Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
Simplified fetch algorithm as much as possible (#875) Fixed seeking behavior Updated getMediaIndexForTime to be simple and stupid Remove spurious console logs Fixed an issue with forward seeks and a different problem with backwards seeking (thanks Matt!). Fixed fast rendition change behavior. Remove limits on gap-skipper. Skip instantly without waiting. Use the proper native MediaSource duration for buffer removals. Improvements for live stream rendition changes Fixed an undefined variable bug Some more simplification and a very conservative live stream rendition change approach VOD fixes Experimental change to the way we throttle the fetcher Use GOAL_BUFFER_LENGTH again Continued massive changes to segment fetching. Cleanup and comments. Fixed a bug where we were fetching starting at mediaIndex 0 on every seek. Refactor probing code in preparation for pulling into it's own module or class Moved sync-related logic out of segment-loader and into a new sync-controller class Removed expired from the SegmentLoader Update mux.js dependency to 2.5.0 Don't error when the tsprobe returns null Fixed two issues: MAAT switching and Flash seeking Rename duration variable fix flash failing first segment load (#859) dont use tech for has played (#861) Code Coverage and Unit tests for Simple Fetcher (#862) fix has played returning false on vod (#866) Fixed preload="none" behavior and reduced the incidence of repeating initial segment requests (#878) Provide option to set contrib-hls first in the HTML5 tech (#889) This reverts commit 59ddbe1188c0b4a1d55d63fa7a334174001fbd28. Add playback tests (#894) Fixed MSE and environment test helpers, restore properly Removed unused test files remove expired time tracking and use sync points to calculate seekable (#898) Fixing a few tests for QUnit 2.0
9 years ago
  1. import QUnit from 'qunit';
  2. import {default as SyncController,
  3. syncPointStrategies as strategies } from '../src/sync-controller.js';
  4. import { playlistWithDuration } from './test-helpers.js';
  5. function getStrategy(name) {
  6. for (let i = 0; i < strategies.length; i++) {
  7. if (strategies[i].name === name) {
  8. return strategies[i];
  9. }
  10. }
  11. throw new Error('No sync-strategy named "${name}" was found!');
  12. }
  13. QUnit.module('SyncController', {
  14. beforeEach() {
  15. this.syncController = new SyncController();
  16. }
  17. });
  18. QUnit.test('returns correct sync point for VOD strategy', function(assert) {
  19. const playlist = playlistWithDuration(40);
  20. let duration = 40;
  21. const timeline = 0;
  22. const vodStrategy = getStrategy('VOD');
  23. let syncPoint = vodStrategy.run(this.syncController, playlist, duration, timeline);
  24. assert.deepEqual(syncPoint, { time: 0, segmentIndex: 0 }, 'sync point found for vod');
  25. duration = Infinity;
  26. syncPoint = vodStrategy.run(this.syncController, playlist, duration, timeline);
  27. assert.equal(syncPoint, null, 'no syncpoint found for non vod ');
  28. });
  29. QUnit.test('returns correct sync point for ProgramDateTime strategy', function(assert) {
  30. const strategy = getStrategy('ProgramDateTime');
  31. const datetime = new Date(2012, 11, 12, 12, 12, 12);
  32. const playlist = playlistWithDuration(40);
  33. const timeline = 0;
  34. const duration = Infinity;
  35. let syncPoint;
  36. syncPoint = strategy.run(this.syncController, playlist, duration, timeline);
  37. assert.equal(syncPoint, null, 'no syncpoint when datetimeToDisplayTime not set');
  38. playlist.segments[0].dateTimeObject = datetime;
  39. this.syncController.setDateTimeMapping(playlist);
  40. const newPlaylist = playlistWithDuration(40);
  41. syncPoint = strategy.run(this.syncController, newPlaylist, duration, timeline);
  42. assert.equal(syncPoint, null, 'no syncpoint when datetimeObject not set on playlist');
  43. newPlaylist.segments[0].dateTimeObject = new Date(2012, 11, 12, 12, 12, 22);
  44. syncPoint = strategy.run(this.syncController, newPlaylist, duration, timeline);
  45. assert.deepEqual(syncPoint, {
  46. time: 10,
  47. segmentIndex: 0
  48. }, 'syncpoint found for ProgramDateTime set');
  49. });
  50. QUnit.test('ProgramDateTime strategy finds nearest segment for sync', function(assert) {
  51. const strategy = getStrategy('ProgramDateTime');
  52. const playlist = playlistWithDuration(200);
  53. const timeline = 0;
  54. const duration = Infinity;
  55. let syncPoint;
  56. syncPoint = strategy.run(this.syncController, playlist, duration, timeline, 170);
  57. assert.equal(syncPoint, null, 'no syncpoint when datetimeToDisplayTime not set');
  58. playlist.segments.forEach((segment, index) => {
  59. segment.dateTimeObject = new Date(2012, 11, 12, 12, 12, 12 + (index * 10));
  60. });
  61. this.syncController.setDateTimeMapping(playlist);
  62. const newPlaylist = playlistWithDuration(200);
  63. syncPoint = strategy.run(this.syncController, newPlaylist, duration, timeline);
  64. assert.equal(syncPoint, null, 'no syncpoint when datetimeObject not set on playlist');
  65. newPlaylist.segments.forEach((segment, index) => {
  66. segment.dateTimeObject = new Date(2012, 11, 12, 12, 12, 22 + (index * 10));
  67. });
  68. syncPoint = strategy.run(this.syncController, newPlaylist, duration, timeline, 170);
  69. assert.deepEqual(syncPoint, {
  70. time: 160,
  71. segmentIndex: 15
  72. }, 'syncpoint found for ProgramDateTime set');
  73. syncPoint = strategy.run(this.syncController, newPlaylist, duration, timeline, 0);
  74. assert.deepEqual(syncPoint, {
  75. time: 10,
  76. segmentIndex: 0
  77. }, 'syncpoint found for ProgramDateTime set at 0');
  78. });
  79. QUnit.test(
  80. 'Does not set date time mapping if date time info not on first segment',
  81. function(assert) {
  82. const playlist = playlistWithDuration(40);
  83. playlist.segments[1].dateTimeObject = new Date(2012, 11, 12, 12, 12, 12);
  84. this.syncController.setDateTimeMapping(playlist);
  85. assert.notOk(this.syncController.datetimeToDisplayTime, 'did not set datetime mapping');
  86. playlist.segments[0].dateTimeObject = new Date(2012, 11, 12, 12, 12, 2);
  87. this.syncController.setDateTimeMapping(playlist);
  88. assert.ok(this.syncController.datetimeToDisplayTime, 'did set date time mapping');
  89. }
  90. );
  91. QUnit.test('returns correct sync point for Segment strategy', function(assert) {
  92. const strategy = getStrategy('Segment');
  93. const playlist = {
  94. segments: [
  95. { timeline: 0 },
  96. { timeline: 0 },
  97. { timeline: 1, start: 10 },
  98. { timeline: 1, start: 20 },
  99. { timeline: 1 },
  100. { timeline: 1 },
  101. { timeline: 1, start: 50 },
  102. { timeline: 1, start: 60 }
  103. ]
  104. };
  105. let currentTimeline;
  106. let syncPoint;
  107. currentTimeline = 0;
  108. syncPoint = strategy.run(this.syncController, playlist, 80, currentTimeline, 0);
  109. assert.equal(syncPoint, null, 'no syncpoint for timeline 0');
  110. currentTimeline = 1;
  111. syncPoint = strategy.run(this.syncController, playlist, 80, currentTimeline, 30);
  112. assert.deepEqual(
  113. syncPoint, { time: 20, segmentIndex: 3 },
  114. 'closest sync point found'
  115. );
  116. syncPoint = strategy.run(this.syncController, playlist, 80, currentTimeline, 40);
  117. assert.deepEqual(
  118. syncPoint, { time: 50, segmentIndex: 6 },
  119. 'closest sync point found'
  120. );
  121. syncPoint = strategy.run(this.syncController, playlist, 80, currentTimeline, 50);
  122. assert.deepEqual(
  123. syncPoint, { time: 50, segmentIndex: 6 },
  124. 'exact sync point found'
  125. );
  126. });
  127. QUnit.test('returns correct sync point for Discontinuity strategy', function(assert) {
  128. const strategy = getStrategy('Discontinuity');
  129. const playlist = {
  130. targetDuration: 10,
  131. discontinuitySequence: 2,
  132. discontinuityStarts: [2, 5],
  133. segments: [
  134. { timeline: 2, start: 20, end: 30, duration: 10 },
  135. { timeline: 2, start: 30, end: 40, duration: 10 },
  136. { timeline: 3, start: 40, end: 50, duration: 10, discontinuity: true },
  137. { timeline: 3, start: 50, end: 60, duration: 10 },
  138. { timeline: 3, start: 60, end: 70, duration: 10 },
  139. { timeline: 4, start: 70, end: 80, duration: 10, discontinuity: true },
  140. { timeline: 4, start: 80, end: 90, duration: 10 },
  141. { timeline: 4, start: 90, end: 100, duration: 10 }
  142. ]
  143. };
  144. const segmentInfo = {
  145. playlist,
  146. segment: playlist.segments[2],
  147. mediaIndex: 2
  148. };
  149. let currentTimeline = 3;
  150. let syncPoint;
  151. syncPoint = strategy.run(this.syncController, playlist, 100, currentTimeline, 0);
  152. assert.equal(syncPoint, null, 'no sync point when no discontinuities saved');
  153. this.syncController.saveDiscontinuitySyncInfo_(segmentInfo);
  154. syncPoint = strategy.run(this.syncController, playlist, 100, currentTimeline, 55);
  155. assert.deepEqual(
  156. syncPoint, { time: 40, segmentIndex: 2 },
  157. 'found sync point for timeline 3'
  158. );
  159. segmentInfo.mediaIndex = 6;
  160. segmentInfo.segment = playlist.segments[6];
  161. currentTimeline = 4;
  162. this.syncController.saveDiscontinuitySyncInfo_(segmentInfo);
  163. syncPoint = strategy.run(this.syncController, playlist, 100, currentTimeline, 90);
  164. assert.deepEqual(
  165. syncPoint, { time: 70, segmentIndex: 5 },
  166. 'found sync point for timeline 4'
  167. );
  168. });
  169. QUnit.test('returns correct sync point for Playlist strategy', function(assert) {
  170. const strategy = getStrategy('Playlist');
  171. const playlist = { mediaSequence: 100 };
  172. let syncPoint;
  173. syncPoint = strategy.run(this.syncController, playlist, 40, 0);
  174. assert.equal(syncPoint, null, 'no sync point if no sync info');
  175. playlist.mediaSequence = 102;
  176. playlist.syncInfo = { time: 10, mediaSequence: 100};
  177. syncPoint = strategy.run(this.syncController, playlist, 40, 0);
  178. assert.deepEqual(
  179. syncPoint, { time: 10, segmentIndex: -2 },
  180. 'found sync point in playlist'
  181. );
  182. });
  183. QUnit.test('saves expired info onto new playlist for sync point', function(assert) {
  184. const oldPlaylist = playlistWithDuration(50);
  185. const newPlaylist = playlistWithDuration(50);
  186. oldPlaylist.mediaSequence = 100;
  187. newPlaylist.mediaSequence = 103;
  188. oldPlaylist.segments[0].start = 390;
  189. oldPlaylist.segments[1].start = 400;
  190. this.syncController.saveExpiredSegmentInfo(oldPlaylist, newPlaylist);
  191. assert.deepEqual(
  192. newPlaylist.syncInfo, { mediaSequence: 101, time: 400 },
  193. 'saved correct info for expired segment onto new playlist'
  194. );
  195. });
  196. QUnit.test('saves segment timing info', function(assert) {
  197. const syncCon = this.syncController;
  198. const playlist = playlistWithDuration(60);
  199. playlist.discontinuityStarts = [3];
  200. playlist.discontinuitySequence = 0;
  201. playlist.segments[3].discontinuity = true;
  202. playlist.segments.forEach((segment, i) => {
  203. if (i >= playlist.discontinuityStarts[0]) {
  204. segment.timeline = 1;
  205. } else {
  206. segment.timeline = 0;
  207. }
  208. });
  209. const updateTimingInfo = (segmentInfo) => {
  210. segmentInfo.timingInfo = {
  211. // offset segment timing to make things interesting
  212. start: segmentInfo.mediaIndex * 10 + 5 + (6 * segmentInfo.timeline),
  213. end: segmentInfo.mediaIndex * 10 + 10 + 5 + (6 * segmentInfo.timeline)
  214. };
  215. };
  216. let segment = playlist.segments[0];
  217. const segmentInfo = {
  218. mediaIndex: 0,
  219. playlist,
  220. timeline: 0,
  221. timestampOffset: 0,
  222. startOfSegment: 0,
  223. segment
  224. };
  225. updateTimingInfo(segmentInfo);
  226. syncCon.saveSegmentTimingInfo({ segmentInfo, shouldSaveTimelineMapping: true });
  227. assert.ok(syncCon.timelines[0], 'created mapping object for timeline 0');
  228. assert.deepEqual(
  229. syncCon.timelines[0], { time: 0, mapping: -5 },
  230. 'mapping object correct'
  231. );
  232. assert.equal(segment.start, 0, 'correctly calculated segment start');
  233. assert.equal(segment.end, 10, 'correctly calculated segment end');
  234. assert.ok(syncCon.discontinuities[1], 'created discontinuity info for timeline 1');
  235. assert.deepEqual(
  236. syncCon.discontinuities[1], { time: 30, accuracy: 3 },
  237. 'discontinuity sync info correct'
  238. );
  239. segmentInfo.timestampOffset = null;
  240. segmentInfo.startOfSegment = 10;
  241. segmentInfo.mediaIndex = 1;
  242. segment = playlist.segments[1];
  243. segmentInfo.segment = segment;
  244. updateTimingInfo(segmentInfo);
  245. syncCon.saveSegmentTimingInfo({ segmentInfo, shouldSaveTimelineMapping: true });
  246. assert.equal(segment.start, 10, 'correctly calculated segment start');
  247. assert.equal(segment.end, 20, 'correctly calculated segment end');
  248. assert.deepEqual(
  249. syncCon.discontinuities[1], { time: 30, accuracy: 2 },
  250. 'discontinuity sync info correctly updated with new accuracy'
  251. );
  252. segmentInfo.timestampOffset = 30;
  253. segmentInfo.startOfSegment = 30;
  254. segmentInfo.mediaIndex = 3;
  255. segmentInfo.timeline = 1;
  256. segment = playlist.segments[3];
  257. segmentInfo.segment = segment;
  258. updateTimingInfo(segmentInfo);
  259. syncCon.saveSegmentTimingInfo({ segmentInfo, shouldSaveTimelineMapping: true });
  260. assert.ok(syncCon.timelines[1], 'created mapping object for timeline 1');
  261. assert.deepEqual(
  262. syncCon.timelines[1], { time: 30, mapping: -11 },
  263. 'mapping object correct'
  264. );
  265. assert.equal(segment.start, 30, 'correctly calculated segment start');
  266. assert.equal(segment.end, 40, 'correctly calculated segment end');
  267. assert.deepEqual(
  268. syncCon.discontinuities[1], { time: 30, accuracy: 0 },
  269. 'discontinuity sync info correctly updated with new accuracy'
  270. );
  271. });
  272. QUnit.test('Correctly calculates expired time', function(assert) {
  273. let playlist = {
  274. targetDuration: 10,
  275. mediaSequence: 100,
  276. discontinuityStarts: [],
  277. syncInfo: {
  278. time: 50,
  279. mediaSequence: 95
  280. },
  281. segments: [
  282. {
  283. duration: 10,
  284. uri: '0.ts'
  285. },
  286. {
  287. duration: 10,
  288. uri: '1.ts'
  289. },
  290. {
  291. duration: 10,
  292. uri: '2.ts'
  293. },
  294. {
  295. duration: 10,
  296. uri: '3.ts'
  297. },
  298. {
  299. duration: 10,
  300. uri: '4.ts'
  301. }
  302. ]
  303. };
  304. let expired = this.syncController.getExpiredTime(playlist, Infinity);
  305. assert.equal(expired, 100, 'estimated expired time using segmentSync');
  306. playlist = {
  307. targetDuration: 10,
  308. discontinuityStarts: [],
  309. mediaSequence: 100,
  310. segments: [
  311. {
  312. duration: 10,
  313. uri: '0.ts'
  314. },
  315. {
  316. duration: 10,
  317. uri: '1.ts',
  318. start: 108.5,
  319. end: 118.4
  320. },
  321. {
  322. duration: 10,
  323. uri: '2.ts'
  324. },
  325. {
  326. duration: 10,
  327. uri: '3.ts'
  328. },
  329. {
  330. duration: 10,
  331. uri: '4.ts'
  332. }
  333. ]
  334. };
  335. expired = this.syncController.getExpiredTime(playlist, Infinity);
  336. assert.equal(expired, 98.5, 'estimated expired time using segmentSync');
  337. playlist = {
  338. discontinuityStarts: [],
  339. targetDuration: 10,
  340. mediaSequence: 100,
  341. syncInfo: {
  342. time: 50,
  343. mediaSequence: 95
  344. },
  345. segments: [
  346. {
  347. duration: 10,
  348. uri: '0.ts'
  349. },
  350. {
  351. duration: 10,
  352. uri: '1.ts',
  353. start: 108.5,
  354. end: 118.5
  355. },
  356. {
  357. duration: 10,
  358. uri: '2.ts'
  359. },
  360. {
  361. duration: 10,
  362. uri: '3.ts'
  363. },
  364. {
  365. duration: 10,
  366. uri: '4.ts'
  367. }
  368. ]
  369. };
  370. expired = this.syncController.getExpiredTime(playlist, Infinity);
  371. assert.equal(expired, 98.5, 'estimated expired time using segmentSync');
  372. playlist = {
  373. targetDuration: 10,
  374. discontinuityStarts: [],
  375. mediaSequence: 100,
  376. syncInfo: {
  377. time: 90.8,
  378. mediaSequence: 99
  379. },
  380. segments: [
  381. {
  382. duration: 10,
  383. uri: '0.ts'
  384. },
  385. {
  386. duration: 10,
  387. uri: '1.ts'
  388. },
  389. {
  390. duration: 10,
  391. uri: '2.ts',
  392. start: 118.5,
  393. end: 128.5
  394. },
  395. {
  396. duration: 10,
  397. uri: '3.ts'
  398. },
  399. {
  400. duration: 10,
  401. uri: '4.ts'
  402. }
  403. ]
  404. };
  405. expired = this.syncController.getExpiredTime(playlist, Infinity);
  406. assert.equal(expired, 100.8, 'estimated expired time using segmentSync');
  407. playlist = {
  408. targetDuration: 10,
  409. discontinuityStarts: [],
  410. mediaSequence: 100,
  411. endList: true,
  412. segments: [
  413. {
  414. duration: 10,
  415. uri: '0.ts'
  416. },
  417. {
  418. duration: 10,
  419. uri: '1.ts'
  420. },
  421. {
  422. duration: 10,
  423. uri: '2.ts'
  424. },
  425. {
  426. duration: 10,
  427. uri: '3.ts'
  428. },
  429. {
  430. duration: 10,
  431. uri: '4.ts'
  432. }
  433. ]
  434. };
  435. expired = this.syncController.getExpiredTime(playlist, 50);
  436. assert.equal(expired, 0, 'estimated expired time using segmentSync');
  437. playlist = {
  438. targetDuration: 10,
  439. discontinuityStarts: [],
  440. mediaSequence: 100,
  441. endList: true,
  442. segments: [
  443. {
  444. start: 0.006,
  445. duration: 10,
  446. uri: '0.ts',
  447. end: 9.982
  448. },
  449. {
  450. duration: 10,
  451. uri: '1.ts'
  452. },
  453. {
  454. duration: 10,
  455. uri: '2.ts'
  456. },
  457. {
  458. duration: 10,
  459. uri: '3.ts'
  460. },
  461. {
  462. duration: 10,
  463. uri: '4.ts'
  464. }
  465. ]
  466. };
  467. expired = this.syncController.getExpiredTime(playlist, 50);
  468. assert.equal(expired, 0, 'estimated expired time using segmentSync');
  469. });