From f44a2fe1d6fec4833ff1737fd4843dfe099820bf Mon Sep 17 00:00:00 2001 From: Lee Whitaker Date: Thu, 24 Apr 2014 15:49:25 -0400 Subject: [PATCH 1/3] Fire playing on buffer full only when we are not pending a pause. --- src/com/videojs/providers/HTTPVideoProvider.as | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/videojs/providers/HTTPVideoProvider.as b/src/com/videojs/providers/HTTPVideoProvider.as index 3656bbe3..79884d33 100644 --- a/src/com/videojs/providers/HTTPVideoProvider.as +++ b/src/com/videojs/providers/HTTPVideoProvider.as @@ -512,16 +512,17 @@ package com.videojs.providers{ break; case "NetStream.Buffer.Full": - _pausedSeekValue = -1; _isBuffering = false; - _isPlaying = true; _model.broadcastEventExternally(ExternalEventName.ON_BUFFER_FULL); _model.broadcastEventExternally(ExternalEventName.ON_CAN_PLAY); - _model.broadcastEventExternally(ExternalEventName.ON_START); if(_pausePending){ _pausePending = false; _ns.pause(); _isPaused = true; + } else { + _pausedSeekValue = -1; + _isPlaying = true; + _model.broadcastEventExternally(ExternalEventName.ON_START); } break; From 17001f89a7c8e526084ad7f70d96d930911045e6 Mon Sep 17 00:00:00 2001 From: Lee Whitaker Date: Thu, 8 May 2014 11:11:23 -0400 Subject: [PATCH 2/3] Check buffering flag was true before emitting playing event. --- src/com/videojs/providers/HTTPVideoProvider.as | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/videojs/providers/HTTPVideoProvider.as b/src/com/videojs/providers/HTTPVideoProvider.as index 79884d33..38ea5dc9 100644 --- a/src/com/videojs/providers/HTTPVideoProvider.as +++ b/src/com/videojs/providers/HTTPVideoProvider.as @@ -512,18 +512,18 @@ package com.videojs.providers{ break; case "NetStream.Buffer.Full": - _isBuffering = false; _model.broadcastEventExternally(ExternalEventName.ON_BUFFER_FULL); _model.broadcastEventExternally(ExternalEventName.ON_CAN_PLAY); if(_pausePending){ _pausePending = false; _ns.pause(); _isPaused = true; - } else { + } else if (_isBuffering) { _pausedSeekValue = -1; _isPlaying = true; _model.broadcastEventExternally(ExternalEventName.ON_START); } + _isBuffering = false; break; case "NetStream.Buffer.Empty": From 86c8b93e80b8693328dea837958183d332581f3d Mon Sep 17 00:00:00 2001 From: Lee Whitaker Date: Thu, 15 May 2014 13:15:02 -0400 Subject: [PATCH 3/3] Only broadcast playing when the buffer is full. --- src/com/videojs/providers/HTTPVideoProvider.as | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/com/videojs/providers/HTTPVideoProvider.as b/src/com/videojs/providers/HTTPVideoProvider.as index 38ea5dc9..4b947154 100644 --- a/src/com/videojs/providers/HTTPVideoProvider.as +++ b/src/com/videojs/providers/HTTPVideoProvider.as @@ -276,7 +276,9 @@ package com.videojs.providers{ _ns.resume(); _isPaused = false; _model.broadcastEventExternally(ExternalEventName.ON_RESUME); - _model.broadcastEventExternally(ExternalEventName.ON_START); + if (!_isBuffering) { + _model.broadcastEventExternally(ExternalEventName.ON_START); + } _model.broadcastEvent(new VideoPlaybackEvent(VideoPlaybackEvent.ON_STREAM_START, {})); } } @@ -301,7 +303,9 @@ package com.videojs.providers{ _ns.resume(); _isPaused = false; _model.broadcastEventExternally(ExternalEventName.ON_RESUME); - _model.broadcastEventExternally(ExternalEventName.ON_START); + if (!_isBuffering) { + _model.broadcastEventExternally(ExternalEventName.ON_START); + } } } @@ -514,13 +518,13 @@ package com.videojs.providers{ case "NetStream.Buffer.Full": _model.broadcastEventExternally(ExternalEventName.ON_BUFFER_FULL); _model.broadcastEventExternally(ExternalEventName.ON_CAN_PLAY); + _pausedSeekValue = -1; + _isPlaying = true; if(_pausePending){ _pausePending = false; _ns.pause(); _isPaused = true; } else if (_isBuffering) { - _pausedSeekValue = -1; - _isPlaying = true; _model.broadcastEventExternally(ExternalEventName.ON_START); } _isBuffering = false;