Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AIR for iOS NetStream Video Volume Control #15

Open
Seb-AS opened this issue Aug 20, 2017 · 7 comments
Open

AIR for iOS NetStream Video Volume Control #15

Seb-AS opened this issue Aug 20, 2017 · 7 comments

Comments

@Seb-AS
Copy link

Seb-AS commented Aug 20, 2017

AIR for iOS NetStream Video Volume Control

https://bugbase.adobe.com/index.cfm?event=bug&id=4196944

I'm loading and running an MP4 just fine in AIR for iOS.
The problem I am having is controlling the volume (muting / unmuting).

I am using soundTransform on the NetStream object, but it is having no effect. It's not erroring either.

var transform:SoundTransform = new SoundTransform();
transform.volume = 0;
netStream.soundTransform = transform;

There is an old problem from Air 3.0.

Note: This property is not supported for H.264 video in AIR 3.0 for iOS.

@PrimaryFeather
Copy link
Contributor

Sebastian, could you please add the latest AIR version you've been using when reproducing this problem? Thx in advance!!

@Seb-AS
Copy link
Author

Seb-AS commented Aug 21, 2017

Sure Daniel,
Last time I tried it was on AIR 25.

thanks

@urthling
Copy link

urthling commented Jun 7, 2018

Are you seeing any issues with AIR 27, 28, 29 or 30?

@itlancer
Copy link

@ajwfrost
Issue still exists with latest AIR 51.0.1.1.
Tested with VideoTexture. To reproduce this issue you could use sample from #1939 (just change video with sound).

@ajwfrost
Copy link
Collaborator

@itlancer thanks for the reminder -> to confirm, is this for MP4 videos (rather than e.g. FLV)?
Per that other issue, there are different code paths used for playing these back on iOS, so it may be a separate bit of glue needs to be added to ensure any NetStream sound transform is then applied to the media...

@itlancer
Copy link

to confirm, is this for MP4 videos (rather than e.g. FLV)?

@ajwfrost
Yes, this is for MP4 H.264 (tested with multiple different videos). I didn't test this issue with FLV.

@itlancer
Copy link

@ajwfrost
With AIR 51.0.1.4 now it works but only if soundTransform applied after NetStream::play() call.
It doesn't work in other case. Here sample:

package {
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.net.NetConnection;
	import flash.net.NetStream;
	import flash.media.StageVideo;
	import flash.geom.Rectangle;
	import flash.events.NetStatusEvent;
	import flash.media.SoundTransform;
	
	public class SoundTransformVolumeIosBug extends Sprite {
		private var nc:NetConnection;
		private var ns:NetStream;
		
		public function SoundTransformVolumeIosBug() {
			addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event):void {
			removeEventListener(Event.ADDED_TO_STAGE, init);
			
			nc = new NetConnection();
			nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
			nc.connect(null);
		}
		
		private function netStatusHandler(event:NetStatusEvent):void {
			trace(event.info.code);
			switch (event.info.code){
				case "NetConnection.Connect.Success":
					ns = new NetStream(nc);
					ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
					ns.client = {onMetaData:getMeta, onPlayStatus:onPlayStatus};
					var sv:StageVideo = stage.stageVideos[0];
					sv.viewPort = new Rectangle(0, 0, 1280, 800);
					
					var st:SoundTransform = new SoundTransform(0);
					ns.soundTransform = st;//This line do nothing for iOS devices
					
					sv.attachNetStream(ns);
					
					ns.play("video.mp4");
					//ns.soundTransform = st;//Here it works
					break;
			}
		}
		
		private function getMeta(mdata:Object):void { }
		
		//Seek video to begin after complete
		private function onPlayStatus(infoObject:Object):void {
			ns.seek(0);
		}
	}
}

Related issues:
#1939
#3260

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants