با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
مصرف باتری به دلیل پخش رسانه چقدر مهم است؟
اجتناب از مصرف غیرضروری باتری جنبه مهم توسعه یک برنامه اندرویدی کارآمد است. پخش رسانه می تواند یکی از دلایل اصلی تخلیه باتری باشد، اما اهمیت آن برای یک برنامه خاص به شدت به الگوهای استفاده از آن بستگی دارد. اگر از یک برنامه فقط برای پخش مقدار کمی رسانه در روز استفاده شود، مصرف باتری مربوطه تنها درصد کمی از کل مصرف دستگاه خواهد بود. در چنین مواردی، اولویت دادن به مجموعه ویژگیها و قابلیت اطمینان نسبت به بهینهسازی باتری هنگام انتخاب پخشکننده، منطقی است. از سوی دیگر، اگر برنامهای اغلب برای پخش حجم زیادی از رسانهها در روز استفاده میشود، بهینهسازی برای مصرف باتری باید هنگام انتخاب بین تعدادی از گزینههای قابل اجرا، سنگینتر باشد.
ExoPlayer چقدر مصرف انرژی دارد؟
ماهیت متنوع دستگاه اندروید و اکوسیستم های محتوای رسانه ای به این معنی است که اظهار نظرهای قابل اجرا در مورد مصرف باتری ExoPlayer دشوار است. عملکرد بسته به سخت افزار، نسخه اندروید و رسانه در حال پخش متفاوت است. از این رو اطلاعات زیر باید فقط به عنوان راهنما تلقی شوند.
پخش ویدیو
برای پخش ویدیو، نمایش و رمزگشایی جریان ویدیو بیشترین انرژی مصرف شده در حین پخش را به خود اختصاص می دهد.
انتخاب بین SurfaceView و TextureView برای خروجی می تواند تأثیر قابل توجهی بر مصرف انرژی داشته باشد. SurfaceView در مصرف انرژی کارآمدتر است و TextureView در برخی دستگاهها مصرف انرژی کل را در حین پخش ویدیو تا 30 درصد افزایش میدهد. بنابراین، SurfaceView باید در صورت امکان ترجیح داده شود. درباره انتخاب بین SurfaceView و TextureViewدر صفحه Surface بیشتر بخوانید.
در برخی از تلویزیونها، استفاده از تونل ویدیویی ممکن است مسیر کارآمدتری را برای پخش ویدیو با وضوح بالا فراهم کند، جایی که مسیر پخش معمولی برای پخش روان کارایی کافی ندارد.
پخش صدا
برای پخشهای کوتاه صدا یا پخشهای زمانی که صفحه روشن است، صدا تأثیر مهمی بر روی قدرت ندارد.
برای پخش طولانی با صفحه خاموش، می توان با استفاده از حالت تخلیه صوتی ExoPlayer در مصرف برق صرفه جویی کرد. برای جزئیات بیشتر در مورد نحوه فعال کردن آن track selection guide ببینید.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Battery consumption\n\nHow important is battery consumption due to media playback?\n-----------------------------------------------------------\n\nAvoiding unnecessary battery consumption is an important aspect of developing a\nperformant Android app. Media playback can be a major cause of battery drain,\nhowever its importance for a particular app heavily depends on its usage\npatterns. If an app is only used to play small amounts of media each day, then\nthe corresponding battery consumption will only be a small percentage of the\ntotal consumption of the device. In such cases, it makes sense to prioritize\nfeature set and reliability over optimizing for battery when selecting which\nplayer to use. On the other hand, if an app is often used to play large amounts\nof media each day, then optimizing for battery consumption should be weighted\nmore heavily when choosing between a number of viable options.\n\nHow power efficient is ExoPlayer?\n---------------------------------\n\nThe diverse nature of the Android device and media content ecosystems means that\nit's difficult to make widely applicable statements about ExoPlayer's battery\nconsumption. Performance varies by hardware, Android version, and the media\nbeing played. Hence the following information should be treated as guidance\nonly.\n\n### Video playback\n\nFor video playback, the display and decoding of the video stream account for\nmost of the power consumed during playback.\n\nChoosing between `SurfaceView` and `TextureView` for output can have a\nsignificant impact on power consumption. `SurfaceView` is more power efficient,\nwith `TextureView` increasing total power draw during video playback by as much\nas 30% on some devices. `SurfaceView` should therefore be preferred where\npossible. Read more about choosing between `SurfaceView` and `TextureView`\n[on the Surface page](/media/media3/ui/surface).\n\nOn some TVs, using [video tunneling](/media/media3/exoplayer/track-selection#tunneling) may provide a more efficient path for\nhigh-resolution video playback where the regular playback path is not performant\nenough for smooth playback.\n| **Note:** Tunneling moves all video decoding and release timing to a dedicated hardware processor. However, be aware that the implementation is device-specific. Performance and reliability can vary greatly between devices. It's highly advisable to test your media streams on the specific TV devices where you intend to enable tunneling to verify it is reliable enough for your use case.\n\n### Audio playback\n\nFor short audio playbacks or playbacks when the screen is on, audio does not\nhave a significant impact on power.\n\nFor long playbacks with the screen off, it's possible to save power by using\nExoPlayer's audio offload mode. See the [`track selection guide`](/media/media3/exoplayer/track-selection#audioOffload) for more\ndetails on how to enable it.\n| **Note:** Audio offload allows audio processing to be offloaded from the CPU to a dedicated signal processor. Device and format support varies, so it's advisable to thoroughly test audio offload with your media on your target devices. Offload also limits the ability to apply audio effects, like speed changes and silence skipping."]]