Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Service file not playing video

Featured Replies

I have written a Python script that receives an online link from the server and downloads it and plays it simultaneously. After that, it plays it from the device unless it receives a new video link. 

I have written a service file that runs this code once the device boots.

 

Service Script


        [Unit]
        Description=My device boot script service
        After=multi-user.target

        [Service]
        Type=idle
        User=root
        Environment=DISPLAY=:0
        Restart=on-failure
        ExecStart=/root/Video_project/start.sh 

        [Install]
        WantedBy=multi-user.target

start.sh script

 

    #!/bin/bash
    #exec 1> >(logger -s -t $(basename $0)) 2>&1
    python /root/Video_project/main.py    

Python function to play video

 

I have these 3 functions running which displays the image and the video   

    def image_func():
        img_link = "https://i.ytimg.com/vi/o4IVan08VvI/maxresdefault.jpg"
        img_cmd = "feh -F %s"%(img_link)
        os.system(img_cmd)

    def play_video_from_server(link):
        print("Playing video from server")
        cmd = "mplayer -fs ffmpeg://%s" %(link)    #link is read from JSON file
        os.system(cmd)

    def play_video_from_device(link_ID):
        print("Playing video from Device")
        cmd = "mplayer -fs %s.mp4" %(link_ID)    #link_ID .mp4 is the name of the downloaded video
        os.system(cmd)


The video player and image viewer never open in the front screen. How should I make it run to view the image and video?

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.