# -*- coding: utf-8 -*-
"""AIR_Widget.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/13DSMlvyBAyKz0NMD4uE8u26KOtQVK5mx
"""
import gradio as gr
import base64
# AIR News 24x7 stream URL
stream_url = "https://air.pc.cdn.bitgravity.com/air/live/pbaudio001/playlist.m3u8"
station_name = "AIR News 24x7"
def generate_iframe():
html_template = f"""
{station_name}
🔈 If playback doesn't start automatically, click play.
"""
html_base64 = base64.b64encode(html_template.encode("utf-8")).decode("utf-8")
iframe_src = f"data:text/html;base64,{html_base64}"
return f""""""
with gr.Blocks() as demo:
gr.Markdown("## 🎙️ AIR News 24x7 Live Stream")
gr.Markdown("▶ Autoplay enabled. If autoplay is blocked, click the play button.")
output = gr.HTML(value=generate_iframe())
demo.launch()