                 return DVRPlugin().minDvrSize
             }
             
-            func buildPlugin(position seconds: Double, playbackType: PlaybackType) -> DVRPlugin {
+            func buildPlugin(duration seconds: Double, playbackType: PlaybackType) -> DVRPlugin {
                 core = Core()
                 container = Container()
                 core.activeContainer = container

                
                context("and playback triggers bufferUpdate") {
                    it("triggers detectDVR with enabled false") {
                        let plugin = buildPlugin(position: getMinDvrSize(), playbackType: .vod)
                        var didHaveDvr = true
                        plugin.core?.activePlayback?.on(InternalEvent.detectDVR.rawValue) { (userInfo: EventUserInfo) in
                            didHaveDvr = (userInfo?["dvrEnabled"] as? Bool) ?? false
                        }
                        
                        plugin.core?.activePlayback?.trigger(Event.bufferUpdate.rawValue)
                        
                        expect(didHaveDvr).toEventually(beFalse())
                    }
                }
                
                context("and core triggers didChangeActivePlayback") {
                    it("triggers detectDVR with enabled false") {
                        let plugin = buildPlugin(position: getMinDvrSize(), playbackType: .vod)
                        var didHaveDvr = true
                        plugin.core?.activePlayback?.on(InternalEvent.detectDVR.rawValue) { (userInfo: EventUserInfo) in
                            didHaveDvr = (userInfo?["dvrEnabled"] as? Bool) ?? false
                        }
                        
                        plugin.core?.trigger(InternalEvent.didChangeActiveContainer.rawValue)
                        
                        expect(didHaveDvr).toEventually(beFalse())
                    }
                }
            }

                    context("and has position higher or equal than minDvrSize") {
                        
                        it("triggers detectDVR with enabled true") {
                            let plugin = buildPlugin(duration: getMinDvrSize(), playbackType: .live)
                            var didHaveDvr = false
                            var expectedDuration: Double?
                            plugin.core?.activePlayback?.on(InternalEvent.detectDVR.rawValue) { (userInfo: EventUserInfo) in
                                didHaveDvr = (userInfo?["dvrEnabled"] as? Bool) ?? false
                                expectedDuration = userInfo?["duration"] as? Double
                            }
                            
                            plugin.core?.trigger(InternalEvent.didChangeActiveContainer.rawValue)
                            
                            expect(didHaveDvr).toEventually(beTrue())
                            expect(expectedDuration).toEventually(equal(getMinDvrSize()))
                        }
                    }
                    
                    context("and has position less than minDvrSize") {
                        
                        it("triggers detectDVR with enabled false") {
                            let duration = getMinDvrSize() - 10
                            let plugin = buildPlugin(duration: duration, playbackType: .live)
                            var didHaveDvr = true
                            var expectedDuration: Double?
                            plugin.core?.activePlayback?.on(InternalEvent.detectDVR.rawValue) { (userInfo: EventUserInfo) in
                                didHaveDvr = (userInfo?["dvrEnabled"] as? Bool) ?? false
                                expectedDuration = userInfo?["duration"] as? Double
                            }
                            
                            plugin.core?.trigger(InternalEvent.didChangeActiveContainer.rawValue)
                            
                            expect(didHaveDvr).toEventually(beFalse())
                            expect(expectedDuration).toEventually(equal(duration))
                        }
                    }
                }
