IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

AppleScript Discussion :

comment mettre en plein écran une vidéo youtube


Sujet :

AppleScript

  1. #1
    Membre très actif
    Homme Profil pro
    Inscrit en
    Février 2013
    Messages
    370
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Février 2013
    Messages : 370
    Par défaut comment mettre en plein écran une vidéo youtube
    bonjour,

    Dans l'inspecteur d'une page web contenant une vidéo youtube,le bouton qui met en plein écran est:
    <button class="ytp-fullscreen-button ytp-button" aria-keyshortcuts="f" data-title-no-tooltip="Plein écran" aria-label="Plein écran Raccourci clavier f"><svg height="100%" version="1.1" viewBox="0 0 36 36" width="100%"><g class="ytp-fullscreen-button-corner-0"><use class="ytp-svg-shadow" xlink:href="#ytp-id-97"></use><path class="ytp-svg-fill" d="m 10,16 2,0 0,-4 4,0 0,-2 L 10,10 l 0,6 0,0 z" id="ytp-id-97"></path></g><g class="ytp-fullscreen-button-corner-1"><use class="ytp-svg-shadow" xlink:href="#ytp-id-98"></use><path class="ytp-svg-fill" d="m 20,10 0,2 4,0 0,4 2,0 L 26,10 l -6,0 0,0 z" id="ytp-id-98"></path></g><g class="ytp-fullscreen-button-corner-2"><use class="ytp-svg-shadow" xlink:href="#ytp-id-99"></use><path class="ytp-svg-fill" d="m 24,24 -4,0 0,2 L 26,26 l 0,-6 -2,0 0,4 0,0 z" id="ytp-id-99"></path></g><g class="ytp-fullscreen-button-corner-3"><use class="ytp-svg-shadow" xlink:href="#ytp-id-100"></use><path class="ytp-svg-fill" d="M 12,20 10,20 10,26 l 6,0 0,-2 -4,0 0,-4 0,0 z" id="ytp-id-100"></path></g></svg></button>

    Le script d'AppleScript permettant d'ouvrir une vidéo youtube spécifique est celui-ci:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
     
    tell application "Google Chrome"
    	activate
    	set theUrl to "https://www.youtube.com/watch?v=0JNabWkrmvc"
     
    	if (count every window) = 0 then
    		make new window
    	end if
     
    	set found to false
    	set theTabIndex to -1
    	repeat with theWindow in every window
    		set theTabIndex to 0
    		repeat with theTab in every tab of theWindow
    			set theTabIndex to theTabIndex + 1
    			if theTab's URL = theUrl then
    				set found to true
    				exit repeat
    			end if
    		end repeat
     
    		if found then
    			exit repeat
    		end if
    	end repeat
     
    	if found then
    		tell theTab to reload
    		set theWindow's active tab index to theTabIndex
    		set index of theWindow to 1
    	else
    		tell window 1 to make new tab with properties {URL:theUrl}
    	end if
    end tell
    Avec l'lélément cité initialement,que rajouter dans ce script pour qu'un clic de souris mette cette vidéo youtube en plein écran après avoir ouvert cette page web?


    merci de votre aide

  2. #2
    Membre habitué
    Homme Profil pro
    retraite
    Inscrit en
    Avril 2023
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activité : retraite

    Informations forums :
    Inscription : Avril 2023
    Messages : 15
    Par défaut
    Bonjour,
    Il me semble plus simple d'envoyer le code key de la touche "F" qui est le raccourci de la mise en plein écran après un délai de 10 secondes pour être sur que la page soit chargée.
    Ton script deviendrai

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    tell application "Google Chrome"
    	activate
    	set theUrl to "https://www.youtube.com/watch?v=0JNabWkrmvc"
     
    	if (count every window) = 0 then
    		make new window
    	end if
     
    	set found to false
    	set theTabIndex to -1
    	repeat with theWindow in every window
    		set theTabIndex to 0
    		repeat with theTab in every tab of theWindow
    			set theTabIndex to theTabIndex + 1
    			if theTab's URL = theUrl then
    				set found to true
    				exit repeat
    			end if
    		end repeat
     
    		if found then
    			exit repeat
    		end if
    	end repeat
     
    	if found then
    		tell theTab to reload
    		set theWindow's active tab index to theTabIndex
    		set index of theWindow to 1
    	else
    		tell window 1 to make new tab with properties {URL:theUrl}
    	end if
    	delay 10
     
    	tell application "System Events"
    		tell application process "Google chrome"
    			key code 3 using {shift down}
    		end tell
    	end tell
     
    end tell

  3. #3
    Membre très actif
    Homme Profil pro
    Inscrit en
    Février 2013
    Messages
    370
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Février 2013
    Messages : 370
    Par défaut
    merci
    Comment en AppleScript intéragir (cliquer avec souris par exemple) avec des éléments de la page web(un bouton par exemple) défini dans son code html?

Discussions similaires

  1. Mettre en plein écran une application externe
    Par Heathcliff_1 dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 13/08/2020, 22h37
  2. Mettre en arrière-plan une vidéo Youtube
    Par laurentSc dans le forum Vidéo
    Réponses: 2
    Dernier message: 24/03/2015, 14h57
  3. Mettre en arrière-plan une vidéo Youtube
    Par laurentSc dans le forum Mise en page CSS
    Réponses: 1
    Dernier message: 12/10/2014, 14h50
  4. Réponses: 1
    Dernier message: 30/05/2013, 14h54
  5. Comment modifier la bordure d'une vidéo Youtube intégrée
    Par CLion dans le forum Général Conception Web
    Réponses: 2
    Dernier message: 16/06/2011, 18h59

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo