PageRenderTime 75ms CodeModel.GetById 33ms RepoModel.GetById 1ms app.codeStats 2ms

/frameworks/projects/playerglobal/bundles/en_US/docs/flash.media.xml

https://github.com/adufilie/flex-sdk
XML | 3292 lines | 2671 code | 603 blank | 18 comment | 0 complexity | 398e875f47a89b5b98f6be69ec66f0de MD5 | raw file
Possible License(s): Apache-2.0

Large files files are truncated, but you can click here to view the full file

  1. <?xml version="1.0" encoding="UTF-8"?><apiPackage xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" id="flash.media" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiPackage/apiPackage "><apiName class="- topic/title reference/title apiRef/apiName ">flash.media</apiName><apiDetail class="- topic/body reference/refbody apiRef/apiDetail "/><apiClassifier languages="" id="flash.media:ID3Info" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">ID3Info</apiName><shortdesc class="- topic/shortdesc ">
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. The ID3Info class contains properties that reflect ID3 metadata.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  17. The ID3Info class contains properties that reflect ID3 metadata. You can get additional
  18. metadata for MP3 files by accessing the <codeph class="+ topic/ph pr-d/codeph ">id3</codeph>
  19. property of the Sound class; for example, <codeph class="+ topic/ph pr-d/codeph ">mySound.id3.TIME</codeph>.
  20. For more information, see the entry for <codeph class="+ topic/ph pr-d/codeph ">Sound.id3</codeph> and
  21. the ID3 tag definitions at <xref href="http://www.id3.org" class="- topic/xref ">http://www.id3.org</xref>.
  22. </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Sound/id3" class="- topic/link "><linktext class="- topic/linktext ">Sound.id3</linktext></link></related-links><apiValue id="flash.media:ID3Info:album" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">album</apiName><shortdesc class="- topic/shortdesc ">
  23. The name of the album; corresponds to the ID3 2.0 tag TALB.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  24. The name of the album; corresponds to the ID3 2.0 tag TALB.
  25. </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:artist" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">artist</apiName><shortdesc class="- topic/shortdesc ">
  26. The name of the artist; corresponds to the ID3 2.0 tag TPE1.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  27. The name of the artist; corresponds to the ID3 2.0 tag TPE1.
  28. </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:comment" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">comment</apiName><shortdesc class="- topic/shortdesc ">
  29. A comment about the recording; corresponds to the ID3 2.0 tag COMM.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  30. A comment about the recording; corresponds to the ID3 2.0 tag COMM.
  31. </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:genre" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">genre</apiName><shortdesc class="- topic/shortdesc ">
  32. The genre of the song; corresponds to the ID3 2.0 tag TCON.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  33. The genre of the song; corresponds to the ID3 2.0 tag TCON.
  34. </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:songName" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">songName</apiName><shortdesc class="- topic/shortdesc ">
  35. The name of the song; corresponds to the ID3 2.0 tag TIT2.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  36. The name of the song; corresponds to the ID3 2.0 tag TIT2.
  37. </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:track" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">track</apiName><shortdesc class="- topic/shortdesc ">
  38. The track number; corresponds to the ID3 2.0 tag TRCK.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  39. The track number; corresponds to the ID3 2.0 tag TRCK.
  40. </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:ID3Info:year" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">year</apiName><shortdesc class="- topic/shortdesc ">
  41. The year of the recording; corresponds to the ID3 2.0 tag TYER.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="AS3" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="Lite" version="4" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiProperty class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiProperty "/><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiDynamic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiDynamic "/><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  42. The year of the recording; corresponds to the ID3 2.0 tag TYER.
  43. </apiDesc></apiValueDetail></apiValue></apiClassifier><apiClassifier languages="" id="flash.media:MediaType" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">MediaType</apiName><shortdesc class="- topic/shortdesc ">
  44. The MediaType class enumerates the general types of media that can be returned by a camera.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">Object</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  45. The MediaType class enumerates the general types of media that can be returned by a camera.
  46. <p class="- topic/p ">Use the constants defined in this class as input to the <codeph class="+ topic/ph pr-d/codeph ">launch()</codeph> method
  47. of the CameraUI class. MediaType values are also used in the <codeph class="+ topic/ph pr-d/codeph ">mediaType</codeph> property
  48. of the MediaPromise class.</p>
  49. </apiDesc></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.media.xml#CameraUI/launch()" class="- topic/link "><linktext class="- topic/linktext ">CameraUI.launch()</linktext></link><link href="" invalidHref="flash.media.MediaPromise.mediaType.xml" class="- topic/link "><linktext class="- topic/linktext ">MediaPromise.mediaType</linktext></link></related-links><apiValue id="flash.media:MediaType:IMAGE" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">IMAGE</apiName><shortdesc class="- topic/shortdesc ">
  50. A single image.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">image</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  51. A single image.
  52. </apiDesc></apiValueDetail></apiValue><apiValue id="flash.media:MediaType:VIDEO" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiValue/apiValue "><apiName class="- topic/title reference/title apiRef/apiName ">VIDEO</apiName><shortdesc class="- topic/shortdesc ">
  53. A video.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="AIR" version="2.5" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiValueDetail class="- topic/body reference/refbody apiRef/apiDetail apiValue/apiValueDetail "><apiValueDef class="- topic/section reference/section apiRef/apiDef apiValue/apiValueDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiData class="- topic/ph reference/ph apiRef/apiData ">video</apiData><apiValueClassifier class="- topic/xref reference/xref apiRef/apiRelation apiValue/apiValueClassifier ">String</apiValueClassifier></apiValueDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  54. A video.
  55. </apiDesc></apiValueDetail></apiValue></apiClassifier><apiOperation id="globalOperation:flash.media:scanHardware" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">scanHardware</apiName><shortdesc class="- topic/shortdesc ">
  56. Forces a rescan of the microphones and cameras on the system.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="10.1" class="+ topic/ph adobe-api-d/apiPlatform "/><apiPlatform description="" name="AIR" version="1.0" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiType value="void" name="type" class="- topic/state reference/state apiRef/apiType "/></apiReturn></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  57. Forces a rescan of the microphones and cameras on the system.
  58. </apiDesc></apiOperationDetail></apiOperation><apiClassifier languages="" id="flash.media:Camera" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier "><apiName class="- topic/title reference/title apiRef/apiName ">Camera</apiName><shortdesc class="- topic/shortdesc ">
  59. Use the Camera class to capture video from the client system's camera.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">Camera, video
  60. </keyword></asCustoms></prolog><apiClassifierDetail class="- topic/body reference/refbody apiRef/apiDetail apiClassifier/apiClassifierDetail "><apiClassifierDef class="- topic/section reference/section apiRef/apiDef apiClassifier/apiClassifierDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiFinal class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiFinal "/><apiBaseClassifier class="- topic/xref reference/xref apiRef/apiRelation apiClassifier/apiBaseClassifier ">flash.events:EventDispatcher</apiBaseClassifier></apiClassifierDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  61. Use the Camera class to capture video from the client system's camera.
  62. Use the Video class to monitor the video locally.
  63. Use the NetConnection and NetStream classes to transmit the video to Flash Media Server.
  64. Flash Media Server can send the video stream to other servers and broadcast it to other clients running Flash Player.
  65. <p class="- topic/p ">A Camera instance captures video in landscape aspect ratio. On devices that can change the screen orientation,
  66. such as mobile phones, a Video object attached to the camera will only show upright video in a landscape-aspect orientation.
  67. Thus, mobile apps should use a landscape orientation when displaying video and should not auto-rotate.</p>
  68. <p class="- topic/p ">As of AIR 2.6, autofocus is enabled automatically on mobile devices with an autofocus camera. If the camera does not support continuous autofocus,
  69. and many mobile device cameras do not, then the camera is focused when the Camera object is attached to a video stream and whenever
  70. the <codeph class="+ topic/ph pr-d/codeph ">setMode()</codeph> method is called. On desktop computers, autofocus behavior is dependent on the camera driver and settings.</p>
  71. <p class="- topic/p ">In an AIR application on Android and iOS, the camera does not capture video while an AIR app is not the active, foreground application.
  72. In addition, streaming connections can be lost when the application is in the background. On iOS, the camera video cannot be
  73. displayed when an application uses the GPU rendering mode. The camera video can still be streamed to a server.</p>
  74. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Mobile Browser Support:</b> This class is not supported in mobile browsers.</p>
  75. <p class="- topic/p "><i class="+ topic/ph hi-d/i ">AIR profile support:</i> This feature is supported
  76. on desktop operating systems, but it is not supported on all mobile devices. It is not
  77. supported on AIR for TV devices. See
  78. <xref href="http://help.adobe.com/en_US/air/build/WS144092a96ffef7cc16ddeea2126bb46b82f-8000.html" class="- topic/xref ">
  79. AIR Profile Support</xref> for more information regarding API support across multiple profiles.</p>
  80. <p class="- topic/p ">You can test
  81. for support at run time using the <codeph class="+ topic/ph pr-d/codeph ">Camera.isSupported</codeph> property.
  82. Note that for AIR for TV devices, <codeph class="+ topic/ph pr-d/codeph ">Camera.isSupported</codeph> is <codeph class="+ topic/ph pr-d/codeph ">true</codeph> but
  83. <codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera()</codeph> always returns <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.</p>
  84. <p class="- topic/p ">
  85. For information about capturing audio, see the Microphone class.
  86. </p>
  87. <p class="- topic/p ">
  88. <b class="+ topic/ph hi-d/b ">Important: </b>Flash Player displays a Privacy dialog box that lets the user choose whether
  89. to allow or deny access to the camera. Make sure your application window size is at least 215 x 138 pixels;
  90. this is the minimum size required to display the dialog box.
  91. </p>
  92. <p class="- topic/p ">To create or reference a Camera object, use the <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> method.</p>
  93. </apiDesc><example conref="examples\CameraExample.as" class="- topic/example "> The following example shows the image from a camera after acknowledging the
  94. security warning. The Stage is set such that it cannot be scaled and is aligned to the
  95. top-left of the player window. The <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event is dispatched at the
  96. start and end (if any) of the session and is captured by the <codeph class="+ topic/ph pr-d/codeph ">activityHandler()</codeph>
  97. method, which prints out information about the event.
  98. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> A camera must be attached to your computer for this example
  99. to work correctly.</p>
  100. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  101. package {
  102. import flash.display.Sprite;
  103. import flash.display.StageAlign;
  104. import flash.display.StageScaleMode;
  105. import flash.events.*;
  106. import flash.media.Camera;
  107. import flash.media.Video;
  108. public class CameraExample extends Sprite {
  109. private var video:Video;
  110. public function CameraExample() {
  111. stage.scaleMode = StageScaleMode.NO_SCALE;
  112. stage.align = StageAlign.TOP_LEFT;
  113. var camera:Camera = Camera.getCamera();
  114. if (camera != null) {
  115. camera.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
  116. video = new Video(camera.width * 2, camera.height * 2);
  117. video.attachCamera(camera);
  118. addChild(video);
  119. } else {
  120. trace("You need a camera.");
  121. }
  122. }
  123. private function activityHandler(event:ActivityEvent):void {
  124. trace("activityHandler: " + event);
  125. }
  126. }
  127. }
  128. </codeblock></example></apiClassifierDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Microphone" class="- topic/link "><linktext class="- topic/linktext ">flash.media.Microphone</linktext></link><link href="http://coenraets.org/blog/2010/07/video-chat-for-android-in-30-lines-of-code/" class="- topic/link "><linktext class="- topic/linktext ">Cristophe Coenraets: Video Chat for Android in 30 Lines of Code</linktext></link><link href="http://www.riagora.com/2010/07/android-air-and-the-camera/" class="- topic/link "><linktext class="- topic/linktext ">Michael Chaize: Android, AIR, and the Camera</linktext></link></related-links><adobeApiEvent id="flash.media:Camera_flash.events.StatusEvent.STATUS_status" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">status</apiName><shortdesc class="- topic/shortdesc ">
  129. Dispatched when a camera reports its status.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.StatusEvent.STATUS</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.StatusEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  130. Dispatched when a camera reports its status.
  131. Before accessing a camera, Flash Player displays a Privacy dialog box to let users
  132. allow or deny access to their camera. If the value of the <codeph class="+ topic/ph pr-d/codeph ">code</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">"Camera.Muted"</codeph>,
  133. the user has refused to allow the SWF file access to the user's camera.
  134. If the value of the <codeph class="+ topic/ph pr-d/codeph ">code</codeph> property is <codeph class="+ topic/ph pr-d/codeph ">"Camera.Unmuted"</codeph>,
  135. the user has allowed the SWF file access to the user's camera.
  136. </apiDesc></adobeApiEventDetail><related-links class="- topic/related-links "><link href="flash.media.xml#Camera/getCamera()" class="- topic/link "><linktext class="- topic/linktext ">Camera.getCamera()</linktext></link></related-links></adobeApiEvent><adobeApiEvent id="flash.media:Camera_flash.events.ActivityEvent.ACTIVITY_activity" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef adobeApiEvent/adobeApiEvent "><apiName class="- topic/title reference/title apiRef/apiName ">activity</apiName><shortdesc class="- topic/shortdesc ">
  137. Dispatched when a camera begins or ends a session.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata></prolog><adobeApiEventDetail class="- topic/body reference/refbody apiRef/apiDetail adobeApiEvent/adobeApiEventDetail "><adobeApiEventDef class="- topic/section reference/section apiRef/apiDef adobeApiEvent/adobeApiEventDef "><apiEventType class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiEventType ">flash.events.ActivityEvent.ACTIVITY</apiEventType><adobeApiEventClassifier class="- topic/xref reference/xref apiRef/apiRelation adobeApiEvent/adobeApiEventClassifier ">flash.events.ActivityEvent</adobeApiEventClassifier><apiGeneratedEvent class="- topic/state reference/state apiRef/apiQualifier adobeApiEvent/apiGeneratedEvent "/></adobeApiEventDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  138. Dispatched when a camera begins or ends a session.
  139. Call <codeph class="+ topic/ph pr-d/codeph ">Camera.setMotionLevel()</codeph> to specify the amount of motion
  140. required to trigger an <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event with an <codeph class="+ topic/ph pr-d/codeph ">activating</codeph>
  141. value of <codeph class="+ topic/ph pr-d/codeph ">true</codeph>, or the time without activity
  142. that must elapse before triggering an <codeph class="+ topic/ph pr-d/codeph ">activity</codeph> event with an <codeph class="+ topic/ph pr-d/codeph ">activating</codeph>
  143. value of <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.
  144. </apiDesc></adobeApiEventDetail></adobeApiEvent><apiOperation id="flash.media:Camera:getCamera" ditaarch:DITAArchVersion="1.0" domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic pr-d api-d)" class="- topic/topic reference/reference apiRef/apiRef apiOperation/apiOperation "><apiName class="- topic/title reference/title apiRef/apiName ">getCamera</apiName><shortdesc class="- topic/shortdesc ">
  145. Returns a reference to a Camera object for capturing video.</shortdesc><prolog class="- topic/prolog "><asMetadata class="+ topic/metadata adobe-api-d/asMetadata "><apiVersion class="+ topic/ph adobe-api-d/apiVersion "><apiLanguage version="3.0" class="+ topic/ph adobe-api-d/apiLanguage "/><apiPlatform description="" name="Flash" version="9" class="+ topic/ph adobe-api-d/apiPlatform "/></apiVersion></asMetadata><asCustoms class="+ topic/metadata adobe-api-d/asCustoms "><keyword class="- topic/keyword ">Camera, video, constructor, Camera.getCamera, getCamera
  146. </keyword></asCustoms></prolog><apiOperationDetail class="- topic/body reference/refbody apiRef/apiDetail apiOperation/apiOperationDetail "><apiOperationDef class="- topic/section reference/section apiRef/apiDef apiOperation/apiOperationDef "><apiAccess value="public" class="- topic/state reference/state apiRef/apiQualifier adobe-api-d/apiAccess "/><apiStatic class="+ topic/state reference/state apiRef/apiQualifier adobe-api-d/apiStatic "/><apiReturn class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiReturn "><apiDesc class="- topic/section reference/section apiRef/apiDesc ">If the <codeph class="+ topic/ph pr-d/codeph ">name</codeph> parameter is not specified, this method returns a reference
  147. to the default camera or, if it is in use by another application, to the first
  148. available camera. (If there is more than one camera installed, the user may specify
  149. the default camera in the Flash Player Camera Settings panel.) If no cameras are available
  150. or installed, the method returns <codeph class="+ topic/ph pr-d/codeph ">null</codeph>.
  151. </apiDesc><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">flash.media:Camera</apiOperationClassifier></apiReturn><apiParam class="- topic/ph reference/ph apiRef/apiDefItem apiOperation/apiParam "><apiItemName class="- topic/keyword reference/keyword apiRef/apiItemName ">name</apiItemName><apiOperationClassifier class="- topic/xref reference/xref apiRef/apiRelation apiOperation/apiOperationClassifier ">String</apiOperationClassifier><apiData class="- topic/ph reference/ph apiRef/apiData ">null</apiData><apiDesc class="- topic/section reference/section apiRef/apiDesc ">Specifies which camera to get, as determined from the array
  152. returned by the <codeph class="+ topic/ph pr-d/codeph ">names</codeph> property. For most applications, get the default camera
  153. by omitting this parameter. To specify a value for this parameter, use the string representation
  154. of the zero-based index position within the Camera.names array. For example, to specify the third
  155. camera in the array, use <codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera("2")</codeph>.
  156. </apiDesc></apiParam></apiOperationDef><apiDesc class="- topic/section reference/section apiRef/apiDesc ">
  157. Returns a reference to a Camera object for capturing video. To begin capturing
  158. the video, you must attach the Camera object to a Video object (see <codeph class="+ topic/ph pr-d/codeph ">Video.attachCamera()
  159. </codeph>). To transmit video to Flash Media Server, call <codeph class="+ topic/ph pr-d/codeph ">NetStream.attachCamera()</codeph>
  160. to attach the Camera object to a NetStream object.
  161. <p class="- topic/p ">Multiple calls to the <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> method reference the same camera driver.
  162. Thus, if your code contains code like <codeph class="+ topic/ph pr-d/codeph ">firstCam:Camera = getCamera()</codeph>
  163. and <codeph class="+ topic/ph pr-d/codeph ">secondCam:Camera = getCamera()</codeph>,
  164. both <codeph class="+ topic/ph pr-d/codeph ">firstCam</codeph> and <codeph class="+ topic/ph pr-d/codeph ">secondCam</codeph> reference the same camera,
  165. which is the user's default camera.</p>
  166. <p class="- topic/p ">On iOS devices with a both a front- and a rear-facing camera, you can only capture
  167. video from one camera at a time. On Android devices, you can only access the rear-facing camera.</p>
  168. <p class="- topic/p ">In general, you shouldn't pass a value for the <codeph class="+ topic/ph pr-d/codeph ">name</codeph> parameter; simply use
  169. <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> to return a reference to the default camera. By means of the Camera
  170. settings panel (discussed later in this section), the user can specify the default camera
  171. to use. </p>
  172. <p class="- topic/p ">You can't use ActionScript to set a user's Allow or Deny permission setting
  173. for access to the camera, but you can display the Adobe Flash Player Settings camera
  174. setting dialog box where the user can set the camera permission. When a SWF file using
  175. the <codeph class="+ topic/ph pr-d/codeph ">attachCamera()</codeph> method tries to
  176. attach the camera returned by the <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> method to a Video or
  177. NetStream object, Flash Player displays a dialog box that lets the user choose
  178. to allow or deny access to the camera. (Make sure your application window size is at least
  179. 215 x 138 pixels; this is the minimum size Flash Player requires to display the dialog box.)
  180. When the user responds to the camera setting dialog box, Flash Player returns an
  181. information object in the <codeph class="+ topic/ph pr-d/codeph ">status</codeph> event that indicates the user's response:
  182. <codeph class="+ topic/ph pr-d/codeph ">Camera.muted</codeph> indicates
  183. the user denied access to a camera; <codeph class="+ topic/ph pr-d/codeph ">Camera.Unmuted</codeph> indicates the user allowed access
  184. to a camera. To determine whether the user has denied or allowed access to the camera without
  185. handling the <codeph class="+ topic/ph pr-d/codeph ">status</codeph> event, use the <codeph class="+ topic/ph pr-d/codeph ">muted</codeph> property.</p>
  186. <p class="- topic/p ">In Flash Player, the user can specify permanent privacy settings for a particular domain by right-clicking
  187. (Windows and Linux) or Control-clicking (Macintosh) while a SWF file is playing, selecting Settings,
  188. opening the Privacy dialog, and selecting Remember. If the user selects Remember, Flash Player no longer
  189. asks the user whether to allow or deny SWF files from this domain access to your camera.</p>
  190. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> The <codeph class="+ topic/ph pr-d/codeph ">attachCamera()</codeph> method will not invoke the dialog box
  191. to Allow or Deny access to the camera if the user has denied access by selecting Remember
  192. in the Flash Player Settings dialog box. In this case, you can prompt the user to change the
  193. Allow or Deny setting by displaying the Flash Player Privacy panel for the user
  194. using <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings(SecurityPanel.PRIVACY)</codeph>.</p>
  195. <p class="- topic/p ">If <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph> returns <codeph class="+ topic/ph pr-d/codeph ">null</codeph>, either the camera is in use by another
  196. application, or there are no cameras installed on the system. To determine whether any cameras
  197. are installed, use the <codeph class="+ topic/ph pr-d/codeph ">names.length</codeph> property. To display the Flash Player Camera Settings panel,
  198. which lets the user choose the camera to be referenced by <codeph class="+ topic/ph pr-d/codeph ">getCamera()</codeph>, use
  199. <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings(SecurityPanel.CAMERA)</codeph>. </p>
  200. <p class="- topic/p ">Scanning the hardware for cameras takes time. When the runtime finds at least one camera,
  201. the hardware is not scanned again for the lifetime of the player instance. However, if
  202. the runtime doesn't find any cameras, it will scan each time <codeph class="+ topic/ph pr-d/codeph ">getCamera</codeph> is called.
  203. This is helpful if the camera is present but is disabled; if your SWF file provides a
  204. Try Again button that calls <codeph class="+ topic/ph pr-d/codeph ">getCamera</codeph>, Flash Player can find the camera without the
  205. user having to restart the SWF file.</p>
  206. </apiDesc><example conref="examples\Camera_getCameraExample.as" class="- topic/example "> In the following example, after the user allows access to the camera, the attached
  207. camera is used to capture video images. Information about the video stream, such as
  208. the current frames per second, is also displayed.
  209. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">Camera.getCamera()</codeph> method returns a reference to a camera object, or returns null if
  210. no camera is available or installed. The if statement checks whether the camera was found and whether
  211. the user allowed access to the camera. If the user denied access, the <codeph class="+ topic/ph pr-d/codeph ">muted</codeph>
  212. property is set to <codeph class="+ topic/ph pr-d/codeph ">true</codeph>.</p>
  213. <p class="- topic/p ">Usually, when the <codeph class="+ topic/ph pr-d/codeph ">attachCamera()</codeph> method is invoked, a dialog box appears and prompts the
  214. user to allow or deny Flash Player access to the camera. However, if the user denied access
  215. and selected the <codeph class="+ topic/ph pr-d/codeph ">Remember</codeph> option, the dialog box does not appear and nothing displays.
  216. To make sure the user has the option to allow access to the camera, the <codeph class="+ topic/ph pr-d/codeph ">myTextField</codeph> text field
  217. instructs the user to click the text field to invoke the Flash Player Settings dialog box.</p>
  218. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">clickHandler()</codeph> method calls <codeph class="+ topic/ph pr-d/codeph ">Security.showSettings()</codeph> method, which
  219. displays the <codeph class="+ topic/ph pr-d/codeph ">PRIVACY</codeph> panel of the Settings dialog box. If the user allows access,
  220. the <codeph class="+ topic/ph pr-d/codeph ">StatusEvent.STATUS</codeph> event is dispatched and the value of the event's <codeph class="+ topic/ph pr-d/codeph ">code</codeph>
  221. property is set to <codeph class="+ topic/ph pr-d/codeph ">Camera.Unmuted</codeph>. (The camera object's <codeph class="+ topic/ph pr-d/codeph ">mute</codeph> property is also
  222. set to <codeph class="+ topic/ph pr-d/codeph ">false</codeph>.)</p>
  223. <p class="- topic/p ">The <codeph class="+ topic/ph pr-d/codeph ">statusHandler()</codeph> method, added to listen to the status change of the user's setting,
  224. invokes the <codeph class="+ topic/ph pr-d/codeph ">connectCamera()</codeph> method, if the user allows access. The <codeph class="+ topic/ph pr-d/codeph ">connectCamera()</codeph>
  225. method instantiates a video object with the captured stream's width and height. To display the
  226. camera's captured video, the reference to the video stream is attached to the video object, and the video
  227. object is added to the display list.</p>
  228. <p class="- topic/p ">A Timer object also is started. Every second, a Timer object's timer event is dispatched and the
  229. <codeph class="+ topic/ph pr-d/codeph ">timerHandler()</codeph> method is invoked. The <codeph class="+ topic/ph pr-d/codeph ">timerHandler()</codeph> method is displayed and updates
  230. a number of properties of the Camera object. </p>
  231. <p class="- topic/p "><b class="+ topic/ph hi-d/b ">Note:</b> For this example, the only property that changes
  232. is the <codeph class="+ topic/ph pr-d/codeph ">currentFPS</codeph> property.</p>
  233. <codeblock xml:space="preserve" class="+ topic/pre pr-d/codeblock ">
  234. package {
  235. import flash.display.Sprite;
  236. import flash.media.Camera;
  237. import flash.media.Video;
  238. import flash.text.TextField;
  239. import flash.text.TextFieldAutoSize;
  240. import flash.utils.Timer;
  241. import flash.events.TimerEvent;
  242. import flash.events.StatusEvent;
  243. import flash.events.MouseEvent;
  244. import flash.system.SecurityPanel;
  245. import flash.system.Security;
  246. public class Camera_getCameraExample extends Sprite {
  247. private var myTextField:TextField;
  248. private var cam:Camera;
  249. private var t:Timer = new Timer(1000);
  250. public function Camera_getCameraExample() {
  251. myTextField = new TextField();
  252. myTextField.x = 10;
  253. myTextField.y = 10;
  254. myTextField.background = true;
  255. myTextField.selectable = false;
  256. myTextField.autoSize = TextFieldAutoSize.LEFT;
  257. if (Camera.isSupported)
  258. {
  259. cam = Camera.getCamera();
  260. if (!cam) {
  261. myTextField.text = "No camera is installed.";
  262. } else if (cam.muted) {
  263. myTextField.text = "To enable the use of the camera,\n"
  264. + "please click on this text field.\n"
  265. + "When the Flash Player Settings dialog appears,\n"
  266. + "make sure to select the Allow radio button\n"
  267. + "to grant access to your camera.";
  268. myTextField.addEventListener(MouseEvent.CLICK, clickHandler);
  269. }else {
  270. myTextField.text = "Connecting";
  271. connectCamera();
  272. }
  273. addChild(myTextField);
  274. t.addEventListener(TimerEvent.TIMER, timerHandler);
  275. }else {
  276. myTextField.text = "The Camera class is not supported on this device.";
  277. }
  278. }
  279. private function clickHandler(e:MouseEvent):void {
  280. Security.showSettings(SecurityPanel.PRIVACY);
  281. cam.addEventListener(StatusEvent.STATUS, statusHandler);
  282. myTextField.removeEventListener(MouseEvent.CLICK, clickHandler);
  283. }
  284. private function statusHandler(event:StatusEvent):void {
  285. if (event.code == "Camera.Unmuted") {
  286. connectCamera();
  287. cam.removeEventListener(StatusEvent.STATUS, statusHandler);
  288. }
  289. }
  290. private function connectCamera():void {
  291. var vid:Video = new Video(cam.width, cam.height);
  292. vid.x = 10;
  293. vid.y = 10;
  294. vid.attachCamera(cam);
  295. addChild(vid);
  296. t.start();
  297. }
  298. private function timerHandler(event:TimerEvent):void {
  299. myTextField.y = cam.height + 20;
  300. myTex

Large files files are truncated, but you can click here to view the full file