Skip to content

Instantly share code, notes, and snippets.

@cjcolvar
Created May 15, 2013 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjcolvar/5585764 to your computer and use it in GitHub Desktop.
Save cjcolvar/5585764 to your computer and use it in GitHub Desktop.
VideoElement.as.diff
diff --git a/src/flash/htmlelements/VideoElement.as b/src/flash/htmlelements/VideoElement.as
index 5a3e1ec..6f209cc 100644
--- a/src/flash/htmlelements/VideoElement.as
+++ b/src/flash/htmlelements/VideoElement.as
@@ -242,8 +242,12 @@ package htmlelements
if (_isPreloading) {
-
+ _stream.seek(0);
_stream.pause();
+ _video.attachNetStream(_stream);
+ _soundTransform = new SoundTransform(_volume);
+ _stream.soundTransform = _soundTransform;
+
_isPaused = true;
_isPreloading = false;
@@ -262,6 +266,7 @@ package htmlelements
// stop and restart
_stream.pause();
_video.clear();
+ _video.attachNetStream(null);
}
_currentUrl = url;
@@ -308,7 +313,7 @@ package htmlelements
_stream = new NetStream(_connection);
// explicitly set the sound since it could have come before the connection was made
- _soundTransform = new SoundTransform(_volume);
+ _soundTransform = new SoundTransform(0);
_stream.soundTransform = _soundTransform;
// set the buffer to ensure nice playback
@@ -322,7 +327,6 @@ package htmlelements
customClient.onMetaData = onMetaDataHandler;
_stream.client = customClient;
- _video.attachNetStream(_stream);
// start downloading without playing )based on preload and play() hasn't been called)
// I wish flash had a load() command to make this less awkward
@@ -331,11 +335,10 @@ package htmlelements
//stream.bufferTime = 20;
if(_isRTMP){
var rtmpInfo:Object = parseRTMP(_currentUrl);
- _stream.play(rtmpInfo.stream, 0, 0);
+ _stream.play(rtmpInfo.stream, 0);
}else{
- _stream.play(getCurrentUrl(0), 0, 0);
+ _stream.play(getCurrentUrl(0), 0);
}
- _stream.pause();
_isPreloading = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment